Hi, I have some object which create and execute thread. This thread do some http requests (synapse) and send progress to the object by Application.QueueAsyncCall(MyObject.MyHandleProc, AProgress), it is designed for multithread - have critical section, so I can call it from thread to main thread. But I have problem which occurs some times. In object destructor I clear async queue by calling Application.RemoveAsyncCalls (which is thread safe too). But if thread waiting in critical section (because main thread block it with RemoveAsyncCalls) then after main thread leave critical section, thread post progress but should not because object is going to destroy. This occurs Access violation in ProcessAsyncCallQueue because method MyObject.MyHandleProc doesn't exists any more, this is only pointer to that method. Can ProcessAsyncCallQueue some how check if target still exists?
Regards
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
