<div class="gmail_quote">On Fri, Mar 27, 2009 at 10:14 AM, Darren Dale <span dir="ltr">&lt;<a href="mailto:dsdale24@gmail.com">dsdale24@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a simple question about QThread. The attached simple example illustrates a case where I have a widget that creates and holds a reference to a thread, setting itself as the parent. I need the parent to hold a reference to the thread, so I can interrupt its execution for example. I want to delete the thread when it finishes executing. <br>

<br>What the script demonstrates is that when the widget catches the thread&#39;s finished signal and deletes its reference to the thread, the thread continues to persist until the widget itself goes out of scope. Is this due to a cyclic reference? Can anyone suggest what I have done wrong, how I can improve it?<br>
<br></blockquote><div><br>I see my mistake. the thread&#39;s parent be None instead of the widget.<br></div></div><br>Darren<br>