Application crashing on closing the window Application
-
Hi,
I have a QT C++ singleton class, in which we have a QMLProperty and invokable function, hence registered this class as qmlRegisterSingletonType in main.cpp and using the class object in my qml.
On closing the application, the application crashes.
the singleton class return the address of a static object of the class.
getInstance function:
static myclass myclassObj;
return &myclassObj;Is the above code wrong ? because if i don't use the class object in qml, qt exits neatly with code exited with 0.
Using Qt MSVC compiler to compile and run the application.
-
Hi,
The destructor is empty.
using a Q_INVOKABLE fn :
Q_INVOKABLE bool getvalue(){ return true;}in main.cpp :
registered the object using:
qmlRegisterSingletonType<testinginstance>("Test", 1, 0, "Test",getInstance);in main.qml:
import Test 1.0
property bool value : Test.getvalue() -
if you can post your sample completely, it will help us to help you