开发者

wxwidgets how to close a thread using wxCloseEvent

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜