>I have a question regarding threads.
>Let's assume we have a A. In that class, we have instance of class B as
> a member. We also have a QThread - class C. The class B member is not a
>What if I call "member_B.moveToThread()", how will the object member_B
> be deleted ? Usually, it'll be deleted when the object_A is destroyed.
> But now it's moved to another thread, who is responsible for it's
> deletion ?
If it's not a pointer, it's deleted when the scope is deleted: that is,
when object_A is destroyed.
And since it's been moved to another thread, you cannot delete it there.
That means you MUST move it back before letting it be destroyed.
Thiago Macieira - thiago.macieira (AT) nokia.com
Senior Product Manager - Nokia, Qt Software
Sandakerveien 116, NO-0402 Oslo, Norway
Qt-interest mailing list