Thread.Abort Memory Management
Posted on 2006-10-20
I have an application that spawns a thread to handle some intense processing. My problem comes in when my process makes some calls to a external dll that ends up with a pointer to some memory. When everything runs like it should, the pointer gets disposed of in the thread before it finishes. My problem is that sometimes a person will close this specific form before the thread is finished running. At the form level I am doing a Thread.Abort to close the thread, but I need to determine how dispose of that memory being retained by the pointer. It is being created and disposed of in methods called from the thread. Can someone give me any suggestions?????