]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/console/console.cpp
kill the process launched by wxExecute(ASYNC) to avoid leaving unneeded processes...
[wxWidgets.git] / samples / console / console.cpp
index 5e05c0e7b46cda56f0ccccc37aa0b0af7984c2ce..73f48d327960a1a0be4548d08abd593ff37c7828 100644 (file)
@@ -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."));