<br><br><div class="gmail_quote">On 21 September 2011 15:41, Leonardo M. Ramé <span dir="ltr"><<a href="mailto:l.rame@griensu.com">l.rame@griensu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 2011-09-21 16:28:45 +0200, Mattias Gaertner wrote:<br>
> On Wed, 21 Sep 2011 11:12:12 -0300<br>
> Leonardo M. Ramé <<a href="mailto:l.rame@griensu.com">l.rame@griensu.com</a>> wrote:<br>
><br>
> > On 2011-09-21 15:38:08 +0200, cobines wrote:<br>
> >[...]<br>
> > Well, the "best" way I found is to create a Timer that checks if the<br>
> > thread is terminated, then destroy it.<br>
> ><br>
> > I don't like this. It would be better if the thread can communicate the<br>
> > main form that it has finished, then the main form can destroy it,<br>
> > without using a Timer.<br>
><br>
> Why must the main thread destroy it? The thread can destroy itself.<br>
> Just add a Synchronize call in the destructor or at the end of Execute to let the main thread clear the references.<br>
><br>
> Mattias<br>
><br>
<br>
</div>So, you say that I should use FreeOnTerminate := true, and set MyThread<br>
:= nil on the main thread?.<br>
<div class="im">--<br>
Leonardo M. Ramé<br>
<a href="http://leonardorame.blogspot.com" target="_blank">http://leonardorame.blogspot.com</a><br>
<br>
</div><div><div></div><div class="h5">--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</div></div></blockquote></div><br><br clear="all">How you found a way of resolving your problem?<br><br>I suspect I will be interested in this issue soon.<br>-- <br>Frank Church<br><br>=======================<br><a href="http://devblog.brahmancreations.com">http://devblog.brahmancreations.com</a><br>