Board index » cppbuilder » A strange execution problem (2)
J. Carlos Baraza
![]() CBuilder Developer |
A strange execution problem (2)2004-07-20 06:20:10 PM cppbuilder33 Hi again, First of all, many thanks to all for your quick answers. About my first problem exposed, I've just removed de string deletion, as you all have suggested, and obviusly the servers don't crash. Regarding, the second one, I've tried the most popular anwer (deleting the thread before NULLing the pointer): Quote// Now the threads are finished Quoteth[i] = NULL; I've created the threads with the "FreeOnTerminate" property equal to true (that's the reason why I only NULL every pointer in the array of pointers to server-manager threads, to destroy the array). By the way, the Exception issued is "Access violation" to address 0x00000000. This might be because the pointer th[i] is already NULL, isn't it? So I could simply skip the for loop, and directly "delete[]" the array, that's right? Just one thing. I want to keep the reference to every thread in order to manage an eventual termination order using th[i]->Terminate(); Any other ideas to solve the problem, please? Moreover, under certain running conditions, the above problem is skipped, but the client application crashes when creating (dynamically) an instance of an object that is used masively in my application, and that has been checked to work fine (freeing the memory used and so on). Thanks again, Juan-Carlos Baraza. |