From 3a521917ef3833dae4e06e044ce7042807d9d06b Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 19 Sep 2018 13:50:44 +0200 Subject: [PATCH] fix possible crash when aborting geometry checker --- src/Mod/Part/Gui/TaskCheckGeometry.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index 673a1ee189..0b74eec02b 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -998,12 +998,16 @@ Standard_Boolean BOPProgressIndicator::Show (const Standard_Boolean theForce) Standard_Boolean BOPProgressIndicator::UserBreak() { - // this is needed to check the status outside BOPAlgo_ArgumentAnalyzer - if (canceled) - return Standard_True; - QThread *currentThread = QThread::currentThread(); if (currentThread == myProgress->thread()) { + // this is needed to check the status outside BOPAlgo_ArgumentAnalyzer + // + // Hint: We must make sure to do this only when calling from the GUI + // thread because when calling it from a worker thread the thrown + // exception isn't handled anywhere and thus std::terminate is called + if (canceled) + return Standard_True; + // it suffices to update only every second // to avoid to unnecessarily process events steps++;