A transition job should only keep a reference to the transitioner
for the lifetime of the transition.
Change-Id: I22564d7b6587fed58ef53fd50ad4a700340dc7a4
Reviewed-by: Martin Jones
Reviewed-by: Martin Jones <martin.jones@nokia.com>
QPointF m_toPos;
QQuickItemViewTransitioner::TransitionType m_type;
bool m_isTarget;
+ bool *m_wasDeleted;
protected:
virtual void finished();
, m_item(0)
, m_type(QQuickItemViewTransitioner::NoTransition)
, m_isTarget(false)
+ , m_wasDeleted(0)
{
}
QQuickItemViewTransitionJob::~QQuickItemViewTransitionJob()
{
+ if (m_wasDeleted)
+ *m_wasDeleted = true;
if (m_transitioner)
m_transitioner->runningJobs.remove(this);
}
{
QQuickTransitionManager::finished();
- if (m_transitioner)
+ if (m_transitioner) {
+ bool deleted = false;
+ m_wasDeleted = &deleted;
m_transitioner->finishedTransition(this, m_item);
+ if (deleted)
+ return;
+ m_wasDeleted = 0;
+
+ m_transitioner = 0;
+ }
m_item = 0;
m_toPos.setX(0);