Re: Can't use TComponent in thread object?



brett wrote:
I found out why the thread wasn't executing. The Execute() method
was being called but then I quickly exited from it. In the thread
class, after the FTP object called its Receive() method to download,
I quickly destroyed the FTP object. That's why the exit was so fast.
I was hoping it would block with Resume() but I guess it didn't.

The whole point of Resume is that the call *doesn't* block. Threads would be useless if they blocked.

This means I need to be sure the FTP object doesn't leak after the
thread is destroyed.

The thread should create and destroy the FTP object itself.

--
Rob
.