OSDN Git Service

In calling a subprocess, a wait of 10 msec is inserted between termination check...
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Mon, 12 Nov 2012 11:21:23 +0000 (11:21 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Mon, 12 Nov 2012 11:21:23 +0000 (11:21 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@330 a2be9bc6-48de-4e38-9406-05402d4bc13c

wxSources/MyApp.cpp

index a455490..f98bdf5 100755 (executable)
@@ -1286,17 +1286,22 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname)
                if (waitpid(pid, &status, WNOHANG) != 0) {
                        /*  Already finished, although not detected by wxProcess  */
                        /*  This sometimes happens on ppc Mac  */
+#if LOG_SUBPROCESS
+                       if (fplog)
+                               fprintf(fplog, "OnEndProcess *NOT* called\n");
+#endif
                        proc->Detach();
                        status = WEXITSTATUS(status);
                        break;
                }
 #endif
 #if LOG_SUBPROCESS
-               if (++nn >= 100) {
+               if (++nn >= 10) {
                        fprintf(fplog, "[DEBUG]pid %ld exists\n", pid);
                        nn = 0;
                }
 #endif
+               ::wxMilliSleep(10);
                if (wxGetApp().IsInterrupted()) {
                        /*  User interrupt  */
                        int kflag = wxKILL_CHILDREN;