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
-
For Gerrit Dashboard: QTBUG-18434 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
142309,24 | Fix for deferredDelete() bug when calling the glib loop directly | dev | qt/qtbase | Status: MERGED | -2 | 0 |
145970,4 | Events from outside main loop need higher loopLevel | dev | qt/qtbase | Status: ABANDONED | -1 | 0 |
149561,1 | Fix for deferredDelete() bug when calling the glib loop directly | 5.7 | qt/qtbase | Status: ABANDONED | 0 | 0 |
150527,3 | Fix warnings about constructor initialization order in tst_QObject. | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |