X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c7789014106c9269b0f4ecc1a3071b14f351d3f..87f0b1323b7ac77f02133b836c8dfee63b0fd387:/src/common/process.cpp diff --git a/src/common/process.cpp b/src/common/process.cpp index bdeccf9923..210068e955 100644 --- a/src/common/process.cpp +++ b/src/common/process.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: process.cpp +// Name: src/common/process.cpp // Purpose: Process termination classes // Author: Guilhem Lavaux // Modified by: Vadim Zeitlin to check error codes, added Detach() method @@ -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; } // ---------------------------------------------------------------------------- @@ -162,7 +168,7 @@ bool wxProcess::Exists(int pid) default: case wxKILL_ERROR: case wxKILL_BAD_SIGNAL: - wxFAIL_MSG( _T("unexpected wxProcess::Kill() return code") ); + wxFAIL_MSG( wxT("unexpected wxProcess::Kill() return code") ); // fall through case wxKILL_NO_PROCESS: