Application crash for deleteLater()

  • in my program i delete an object using:

    QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); @

    but sometimes i get this error:


    ~"#0 0xb7029edc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /home/bnm/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#1 0xb7079282 in QTimerInfoList::activateTimers() () from /home/bnm/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#2 0xb7079b38 in ?? () from /home/bnm/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#3 0xb6572d46 in g_main_context_dispatch () from /lib/i386-linux-gnu/\n"
    ~"#4 0xb65730e5 in ?? () from /lib/i386-linux-gnu/\n"
    ~"#5 0xb65731c1 in g_main_context_iteration () from /lib/i386-linux-gnu/\n"
    ~"#6 0xb707a328 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/bnm/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#7 0xb3f44566 in ?? () from /home/bnm/Qt5.1.1/5.1.1/gcc/plugins/platforms/\n"
    ~"#8 0xb70285e6 in QEventLoop::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/bnm/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#9 0xb7028a2c in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /home/bertero/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#10 0xb702d122 in QCoreApplication::exec() () from /home/bnm/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#11 0xb7308d84 in QGuiApplication::exec() () from /home/bnm/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#12 0xb794bbb4 in QApplication::exec() () from /home/bnm/Qt5.1.1/5.1.1/gcc/lib/\n"
    ~"#13 0x08053561 in main (argc=1, argv=0xbffff7c4) at ../project/main.cpp:11\n"

    What could be the problem?

  • I can only guess that myObj is a QTimer's slot receiver, which is destroyed while timer is still running ...

  • inside myobj there are some qtimer declared with:
    myTimer = new QTimer(this)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.