[Qt-interest] Delete QObjects which are moved to different thread

Wilhelm wilhelm.meier at fh-kl.de
Wed Oct 26 09:37:50 CEST 2011


Am 26.10.2011 09:34, schrieb Giuseppe D'Angelo:
> On 26 October 2011 09:27, Wilhelm<wilhelm.meier at fh-kl.de>  wrote:
>> Hi,
>>
>> if I move a QObject to a different QThread and then destroy this object
>> deferred, the dtor is called by this thread, if it is running: ok.
>>
>> But if the other thread is not running, I can't use deferred deletion
>> since there is no running event loop.
>> Trying to delete the object from the main thread via delete operator,
>> the dtor ist called from a different thread than the main thread: I
>> assume the QObject-dtor detects that the object belongs to a different
>> thread and if that is not running it starts a new thread to execute the
>> dtor. Right?
>
> Wrong.
>
So, why is the dtor called by a different thread?

-- 
Wilhelm




More information about the Qt-interest-old mailing list