Hm, TThreadList is good idea. I could try create global ThreadList and add http responses from thread into that list, then only post some notify message to main thread <span id="result_box" class="short_text" lang="en"><span class="hps">which would</span> <span class="hps">mean that main thread should peek and parse objects from ThreadList. I try with that. Thanks</span></span><br>
<br><div class="gmail_quote">2011/9/23 Michael Schnell <span dir="ltr"><<a href="mailto:mschnell@lumino.de">mschnell@lumino.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 09/22/2011 05:28 PM, Krzysztof wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Main problem is: I don't know how to tell thread (which is locked in QueueAsyncCall critical section), that method pointer which he trying to post, doesn't exists anymore.<br>
<br>
</blockquote></div>
Seemingly you want to create a queue of objects and/or strings that are sent from the Thread to the Main thread, and want to be sure that the main thread in fact handles all of them.<br>
<br>
If just doing a progress indicator, it would not harm if some events in the main thread would be dropped, so IMHO it would be a better way to use a global integer variable that is written by the thread and read by the main thread. So no object or string creation is necessary.<br>
<br>
If you really need to dedicatedly handle all events I;HO a good way is to use a TThreadList with "add" in the thread.<br>
<br>
Another thing to watch is how the reference counting strings are handled. Are they correctly kept life when the function that moves them into the object is left ? Are they correctly freed when the object is freed ?<br>
<br>
I usually try to avoid handling strings in such a creative way.<div><div></div><div class="h5"><br>
<br>
-Michael<br>
<br>
--<br>
______________________________<u></u>_________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org" target="_blank">Lazarus@lists.lazarus.<u></u>freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.<u></u>freepascal.org/mailman/<u></u>listinfo/lazarus</a><br>
<br>
</div></div></blockquote></div><br>