From 5590d4aea56173ee644c80ea09984b6d07b0c1df Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Tue, 7 Feb 2012 12:06:49 +1000 Subject: [PATCH] More fixes for QDeclarativeListModelWorkerAgent cleanup 1) Use deleteLater() instead of delete to avoid crashing with any pending events 2) During event processing, return earlier if possible Change-Id: Ia7d6c95acf1175a16b80e952b95909bb5bbc9433 Reviewed-by: Glenn Watson Reviewed-by: Martin Jones --- src/declarative/qml/qdeclarativelistmodelworkeragent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativelistmodelworkeragent.cpp b/src/declarative/qml/qdeclarativelistmodelworkeragent.cpp index 3ae1b32..51ac460 100644 --- a/src/declarative/qml/qdeclarativelistmodelworkeragent.cpp +++ b/src/declarative/qml/qdeclarativelistmodelworkeragent.cpp @@ -114,7 +114,7 @@ void QDeclarativeListModelWorkerAgent::release() bool del = !m_ref.deref(); if (del) - delete this; + deleteLater(); } void QDeclarativeListModelWorkerAgent::modelDestroyed() @@ -236,6 +236,7 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e) if (cc) emit m_orig->countChanged(); + return true; } return QObject::event(e); -- 2.7.4