Important: Please read the Qt Code of Conduct -

Abort at close down of app in QObject destructor

  • Hello all,

    We created an application using QtQuick2. The application works (mostly) but when closing down I get an abort in the destruction of QObject for which I show the stacktrace plus main.cpp below: it is a very short stack trace.

    I have no idea how to approach debugging this, because most of the application is gone, this is AFAICS the last object being deleted.

    Anyone have an idea how to approach this? Or what might be wrong?

    #0  0x00007ffff58ea539 in QObject::~QObject() (this=0x60a278 <dataControl>, __in_chrg=<optimized out>) at kernel/qobject.cpp:924
            d = 0x912640
    #1  0x00007ffff7aaf2a4 in DataControl::~DataControl() (this=0x60a278 <dataControl>, __in_chrg=<optimized out>) at ../../xmd/xmd/datacontrol.cpp:55
    #2  0x00007ffff45bb6ea in __cxa_finalize () at /usr/lib64/
    #3  0x00007ffff7aa8bb3 in __do_global_dtors_aux () at /home/gbonnema/Documents/10-studie-ou/T61327-ABI-Afstudeerproject-Bachelor-Informatica/xmas/src/build-xmd-Desktop-Debug/xmdmain/../xmd/
    #4  0x00007fffffffddc0 in  ()
    #5  0x00007ffff7deb4e7 in _dl_fini () at /lib64/

    The code of main.cpp:

     * Access globals in C++ through statements like
     *      "extern DataControl *dataControl;"
    DataControl *dataControl = nullptr;
    PluginControl *pluginControl = nullptr;
    Util *util = nullptr;
    int main(int argc, char *argv[])
        QApplication app(argc, argv);
        QCoreApplication::setApplicationName("XMAS Model Designer (2015)");
        QCoreApplication::setOrganizationName("Open University NL");
        /* OOAK class registration for Qml access        */
        QQmlApplicationEngine engine;
        QQmlContext* ctx = engine.rootContext();
        DataControl *dataControl = new DataControl();
        ::dataControl = dataControl;
        qmlRegisterType<DataControl>("XMAS", 1, 0, "Data"); // Before engine.load
        ctx->setContextProperty("datacontrol", dataControl);
        PluginControl *pluginControl = new PluginControl();
        ::pluginControl = pluginControl;
        qmlRegisterType<PluginControl>("XMAS", 1, 0, "Plugin"); // Before engine.load
        ctx->setContextProperty("plugincontrol", pluginControl);
        Util *util = new Util();
        ::util = util;
        qmlRegisterType<Util>("XMAS", 1, 0, "Util"); // Before engine.load
        ctx->setContextProperty("util", util);
        /* End of OOAK class registration for Qml access */
        dataControl->registerTypes(); // Before engine.load
        return app.exec();

    The destructor for DataControl is empty. Any ideas?

Log in to reply