Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.7.4
-
None
-
Harmattan Scratchbox/X86
Description
- Define a QObject-derived parent class with a child object of QObject-derived class
- When the child object is created, set its parent to be the parent object
- In the parent class destructor explicitly destroy the child object (or let the compiler do it if the object is embedded into the parent)
- Create an instance of the parent class
- Create a new thread
- Move the parent class instance to the thread with QObject::moveToThread
- Start the thread and wait for it to finish
- Destroy the parent class instance
Expected:
- The parent and child objects will be destroyed cleanly
Actual:
- The child object destruction fails with assertion
ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread xxxxxxx. Receiver '' (of type 'ttt') was created in thread yyyyyyy", file kernel/qcoreapplication.cpp, line 405
Notes:
- If the child is held by a pointer variable, which is not deleted in the parent class destructor there is no assertion failure
- The problem does not exist in Qt 4.7.2 (-0ubuntu6.2), which makes this seem like a regression or at least a change in behavior.
- See also the attached test program.