Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.3, 5.4.0
-
None
Description
The attached source code
1. schedules a function to be called with g_idle_add
2. when the function is called, calls deleteLater on a QObject
3. spins the main loop (QCoreApplication::exec()) the rest of the time
Expected outcome:
The dtor of the QObject in question is called right after the deleteLater, when the main loop spins the next time.
Actual outcome:
The dtor of the QObject in question is called only after QCoreApplication::quit() has been called.
The program prints out:
main thread is QThread(0x922c488)
created Sender(0x922f918)
it's thread affinity: QThread(0x922c488)
adding idle callback QThread(0x922c488)
calling QCoreApplication::exec
callback QThread(0x922c488)
And after 3 s:
destroyed Sender(0x922f918)
QCoreApplication::exec returned
Attachments
Issue Links
- relates to
-
QTBUG-30200 tst_qapplication: testDeleteLaterProcessEvents deleteLaterAndExitLoop fails on Linux (Non-Glib-EventDispatcher)
- Open
-
QTBUG-25752 Application hangs when emit signal on Linux in g_main_context_wakeup
- Closed
-
QTBUG-32859 DeferredDelete events not handled when created by GLib dispatched events
- Closed
- resulted in
-
QTBUG-120124 Improvements to deferred deletions / deleteLater()
- Open