QQmlEninge is becoming null
-
Very peculiar case. QQmlEngine is becoming null. This is happening when the delegate objects are getting created inside the ListView scrolling. After this application crashes.
Anyone has seen this kind of issue ?
-
@jeremy_k
Thanks you. engine variable is 0x0. After that it crashes. -
@dheerendra said in QQmlEninge is becoming null:
@jeremy_k
Thanks you. engine variable is 0x0. After that it crashes.How is this pointer initialized? Is this the value returned from qmlEngine(QObject *), QQmlComponent::engine(), or something else? Is it a QPointer or QWeakPointer?
-
Thank you.
When I analyze the code further found that
class - qqmlconnections.cpp-
method - void QQmlConnections::connectSignalsToMethods()
Line#300
QV4::ExecutionEngine *engine = ddata>context>engine->handle();So here data->context->engine object is becoming 0x0. I think this QPointer.
This happens when the delegate objects are created when the ListView is scrolled up/down. -
@dheerendra said in QQmlEninge is becoming null:
Thank you.
When I analyze the code further found that
class - qqmlconnections.cpp-
method - void QQmlConnections::connectSignalsToMethods()
Line#300
QV4::ExecutionEngine *engine = ddata>context>engine->handle();So here data->context->engine object is becoming 0x0. I think this QPointer.
This happens when the delegate objects are created when the ListView is scrolled up/down.At a glance I don't see a smart pointer involved.
Have you tried connecting to QObject::destroyed() for the engine? That has helped me track several unexpected QObject deletions.