OmniThreadLibrary
OmniThreadLibrary copied to clipboard
When i an object destroyed (or rather released) when send using Task.Comm.Send()?
Hi,
I send an object from a thread to the main thread like this:
var U: IUnknown; ... Task.Comm.Send(MESSAGE_ID, U);
I need to destroy all the objects before the thread ends. Normally, this is not the case: some objects are destroyed after the thread has ended.
I tried Task.Comm.Reader.Empty() and Task.Command.Writer.Empty() but with no success.
How can i force OmniThread to release the objects before the thread ends?