diff --git a/cmd/synergyc/synergyc.cpp b/cmd/synergyc/synergyc.cpp index 095b62ea..4f72a6bd 100644 --- a/cmd/synergyc/synergyc.cpp +++ b/cmd/synergyc/synergyc.cpp @@ -246,16 +246,17 @@ realMain(void) static void -realMainEntry(void*) +realMainEntry(void* vresult) { - CThread::exit(reinterpret_cast(realMain())); + *reinterpret_cast(vresult) = realMain(); } static int runMainInThread(void) { - CThread appThread(new CFunctionJob(&realMainEntry)); + int result; + CThread appThread(new CFunctionJob(&realMainEntry, &result)); try { #if WINDOWS_LIKE MSG msg; @@ -272,7 +273,7 @@ runMainInThread(void) #else appThread.wait(-1.0); #endif - return reinterpret_cast(appThread.getResult()); + return result; } catch (XThread&) { appThread.cancel(); diff --git a/cmd/synergys/synergys.cpp b/cmd/synergys/synergys.cpp index 3adc9f0d..d85c4c6b 100644 --- a/cmd/synergys/synergys.cpp +++ b/cmd/synergys/synergys.cpp @@ -268,16 +268,17 @@ realMain(void) static void -realMainEntry(void*) +realMainEntry(void* vresult) { - CThread::exit(reinterpret_cast(realMain())); + *reinterpret_cast(vresult) = realMain(); } static int runMainInThread(void) { - CThread appThread(new CFunctionJob(&realMainEntry)); + int result; + CThread appThread(new CFunctionJob(&realMainEntry, &result)); try { #if WINDOWS_LIKE MSG msg; @@ -292,7 +293,7 @@ runMainInThread(void) #else appThread.wait(-1.0); #endif - return reinterpret_cast(appThread.getResult()); + return result; } catch (XThread&) { appThread.cancel();