The main program thread (derived from wxConvas) generates the thread for some complicated calculations
When the 开发者_Go百科wxCloseEvent from user arrives I want on this event to delete the thread ,because allowing the thread to continue to work causes memory errors want to know how can I find the thread from main thread in runtime and how exactly I destroy/delete it?
You do not 'find' the thread. When you construct it, you keep it, or a pointer to it, as an attribute. When the application closes, you should overide the wxApp::OnExit () method to delete the thread by calling the method wxThread::Delete() on the stored thread attribute.
精彩评论