JackT 0 Posted January 8 (edited) I am creating a string list on a thread inside a function like this class AQNI : public TThread { //Some definitions } AQNI * mythread; bool AQNI::ReadXMLData { TStringList * ATB = new TStringList(); //Access violation occurs here the 2nd time the thread is created { //DO SOME STUFF } __finally { delete ATB; } return true; } The first time the thread is created everything runs fine. After I have finished with threaded object I destroy the thread and wait for a command and to start a data collection loop at which point I Free and delete mythread. However when I recreate my thread and call the ReadXMLData function when I try to create a fresh string list the whole thing falls over with an access violation. I am surprised the code is broken because it was previously working. The exception is ocuring in BorlndMM ( Borland Memory Manager ) :69d29df9 BORLNDMM.@Borlndmm@SysGetMem$qqri + 0x3d Edited January 8 by JackT Share this post Link to post
Remy Lebeau 1451 Posted January 8 There is not enough information to diagnose your problem. How are you creating and destroying the thread? Are you really destroying the thread TWICE before starting a new thread? What is your thread code doing besides creating the TStringList? We need to see a more complete code example. Share this post Link to post