From a52763c84aaa5f75c73ccceba59fc9ac0b3ebff4 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 14 Oct 2023 17:03:17 -0400 Subject: [PATCH] Match MxEventManager::Create --- LEGO1/mxeventmanager.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/LEGO1/mxeventmanager.cpp b/LEGO1/mxeventmanager.cpp index 697c515f..9f9e8779 100644 --- a/LEGO1/mxeventmanager.cpp +++ b/LEGO1/mxeventmanager.cpp @@ -49,17 +49,16 @@ MxResult MxEventManager::Create(MxU32 p_frequencyMS, MxBool p_createThread) locked = TRUE; this->m_thread = new MxTickleThread(this, p_frequencyMS); - if (this->m_thread) { - if (this->m_thread->Start(0, 0) == SUCCESS) - status = SUCCESS; - } + if (!this->m_thread || this->m_thread->Start(0, 0) != SUCCESS) + goto done; } - else { + else TickleManager()->RegisterClient(this, p_frequencyMS); - status = SUCCESS; - } + + status = SUCCESS; } +done: if (status != SUCCESS) Destroy();