diff --git a/Source/Main.cpp b/Source/Main.cpp index 4244692c1..e879fbf2a 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp @@ -85,10 +85,13 @@ void ChataigneApplication::handleCrashed() { crashSent = true; MatomoAnalytics::getInstance()->log(MatomoAnalytics::CRASH); + MatomoAnalytics::getInstance()->signalThreadShouldExit(); while (MatomoAnalytics::getInstance()->isThreadRunning()) { //wait until thread is done - Thread::getCurrentThread()->wait(10); + Thread* t = Thread::getCurrentThread(); + if (t == nullptr) break; + t->wait(10); } }