X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c7789014106c9269b0f4ecc1a3071b14f351d3f..8f4745feeb2850f3bebb3af45407e164550d541a:/src/common/process.cpp diff --git a/src/common/process.cpp b/src/common/process.cpp index bdeccf9923..26e14c560e 100644 --- a/src/common/process.cpp +++ b/src/common/process.cpp @@ -30,7 +30,7 @@ // event tables and such // ---------------------------------------------------------------------------- -wxDEFINE_EVENT( wxEVT_END_PROCESS, wxProcessEvent ) +wxDEFINE_EVENT( wxEVT_END_PROCESS, wxProcessEvent ); IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler) IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent, wxEvent) @@ -102,7 +102,13 @@ void wxProcess::OnTerminate(int pid, int status) void wxProcess::Detach() { - SetNextHandler(NULL); + // we just detach from the next handler of the chain (i.e. our "parent" -- see ctor) + // not also from the previous handler like wxEvtHandler::Unlink() would do: + + if (m_nextHandler) + m_nextHandler->SetPreviousHandler(m_previousHandler); + + m_nextHandler = NULL; } // ----------------------------------------------------------------------------