Hi there. I seem to be having a similar problem concerning threads and freeing objects. I narrowed down the problem by commenting out code, and it seems to be occuring when I try to free a TClientDataSet I create in the thread's constructor.
I tried creating the TClientDataSet both with owner=nil and owner=application but the problem persists either way.
The strange thing is that the access violation doesn't happen in every instance of the thread which I create and free, but only starts happening when I reach a certain thread count (usually when i exceed 8 threads).
When I remove the line where I try to free the TClientDataSet, the access violation disappears, but I'd really like to free the TClientDataSet in order to avoid taking up memory and perhaps creating memory leaks.
I'd really appreciate any insight and suggestions you may have as to why this is happening and what I can do to solve this problem.
Thanks,
Barak