File tree Expand file tree Collapse file tree
SerialPrograms/Source/CommonFramework Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,19 +234,6 @@ int main(int argc, char *argv[]){
234234 global_watchdog ().stop ();
235235 static_cast <FileWindowLogger&>(global_logger_raw ()).stop ();
236236
237- //
238- // Workaround Qt 6.9 thread-adoption bug on Windows.
239- // https://github.com/PokemonAutomation/Arduino-Source/issues/570
240- // https://bugreports.qt.io/browse/QTBUG-131892
241- //
242- // Joining threads on Qt 6.9+ Windows will hang!
243- //
244- // #ifdef PA_ENABLE_QT_ADOPTION_WORKAROUND
245- // cout << "Qt6.9 bug workaround: abort() to avoid thread join hangs." << endl;
246- // abort();
247- // exit(ret);
248- // #endif
249-
250237 // Force stop the thread pools.
251238 // This is where all the threads in the program are joined.
252239 PokemonAutomation::GlobalThreadPools::computation_realtime ().stop ();
@@ -260,5 +247,17 @@ int main(int argc, char *argv[]){
260247
261248 cout << " Exiting main()..." << endl;
262249
250+ //
251+ // Workaround Qt 6.9 thread-adoption bug on Windows.
252+ // https://github.com/PokemonAutomation/Arduino-Source/issues/570
253+ // https://bugreports.qt.io/browse/QTBUG-131892
254+ //
255+ // Joining threads on Qt 6.9+ Windows will hang!
256+ //
257+ #ifdef PA_ENABLE_QT_ADOPTION_WORKAROUND
258+ cout << " Qt6.9 bug workaround: std::quick_exit() to avoid thread join hangs." << endl;
259+ std::quick_exit (ret);
260+ #endif
261+
263262 return ret;
264263}
You can’t perform that action at this time.
0 commit comments