Added wxThread::OnKill() and OnDelete() callbacks.
Call OnXXX() from wxThread::Kill() and Delete() respectively to allow the thread being terminated perform some cleanup. Closes #9046. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65882 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -686,6 +686,8 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
|
||||
|
||||
wxThreadError wxThreadInternal::Kill()
|
||||
{
|
||||
m_thread->OnKill();
|
||||
|
||||
if ( !::TerminateThread(m_hThread, THREAD_ERROR_EXIT) )
|
||||
{
|
||||
wxLogSysError(_("Couldn't terminate thread"));
|
||||
@@ -759,6 +761,7 @@ wxThreadInternal::WaitForTerminate(wxCriticalSection& cs,
|
||||
Cancel();
|
||||
}
|
||||
|
||||
threadToDelete->OnDelete();
|
||||
|
||||
// now wait for thread to finish
|
||||
if ( wxThread::IsMain() )
|
||||
|
Reference in New Issue
Block a user