From 42c46d5283f413e239250c70328fce4053cfc090 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 21 Mar 2008 23:55:03 +0000 Subject: [PATCH] kill the process launched by wxExecute(ASYNC) to avoid leaving unneeded processes running git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/console/console.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/samples/console/console.cpp b/samples/console/console.cpp index 5e05c0e7b4..73f48d3279 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -565,8 +565,13 @@ static void TestExecute() wxPrintf(_T("Testing async wxExecute: ")); fflush(stdout); - if ( wxExecute(ASYNC_COMMAND) != 0 ) + int pid = wxExecute(ASYNC_COMMAND); + if ( pid != 0 ) + { wxPuts(_T("Ok (command launched).")); + if ( wxKill(pid) == -1 ) + wxPuts("ERROR: failed to kill child process."); + } else wxPuts(_T("ERROR.")); -- 2.47.2