diff --git a/src/shared/ActiveObject.h b/src/shared/ActiveObject.h index acfc07e34984e84a9c9d97d66eb87b60854d1490..2fdbb68c4d905728841ec773ccb2f1312052d9a8 100644 --- a/src/shared/ActiveObject.h +++ b/src/shared/ActiveObject.h @@ -125,7 +125,9 @@ inline bool ActiveObject::start() miosix::Thread::JOINABLE); if (thread == nullptr) + { running = false; + } return running; } @@ -148,7 +150,6 @@ inline bool ActiveObject::shouldStop() { return stopFlag; } inline void ActiveObject::threadLauncher(void* arg) { - reinterpret_cast<ActiveObject*>(arg)->run(); // When the run function ends, update the status