fix possible crash when aborting geometry checker

This commit is contained in:
wmayer
2018-09-19 13:50:44 +02:00
parent 7c76767bc5
commit 3a521917ef

View File

@@ -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++;