From fa0907abe0ecee91cd35878fb0cd0fe8d4daa17e Mon Sep 17 00:00:00 2001 From: disinvite Date: Tue, 7 May 2024 12:26:36 -0400 Subject: [PATCH] Helper function for MxNotificationManager list --- LEGO1/omni/include/mxnotificationmanager.h | 8 ++++++++ LEGO1/omni/src/main/mxomni.cpp | 9 +++------ LEGO1/omni/src/notify/mxnotificationmanager.cpp | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/LEGO1/omni/include/mxnotificationmanager.h b/LEGO1/omni/include/mxnotificationmanager.h index e99f0923..5b1acd50 100644 --- a/LEGO1/omni/include/mxnotificationmanager.h +++ b/LEGO1/omni/include/mxnotificationmanager.h @@ -47,8 +47,13 @@ class MxNotificationManager : public MxCore { MxResult Send(MxCore* p_listener, const MxNotificationParam& p_param); inline MxNotificationPtrList* GetQueue() { return m_queue; } + + // FUNCTION: BETA10 0x10132270 inline void SetActive(MxBool p_active) { m_active = p_active; } + // FUNCTION: BETA10 0x10132230 + inline MxBool IsEmpty() const { return m_queue ? m_queue->empty() : TRUE; } + // SYNTHETIC: LEGO1 0x100ac390 // MxNotificationManager::`scalar deleting destructor' @@ -86,4 +91,7 @@ class MxNotificationManager : public MxCore { // SYNTHETIC: LEGO1 0x100accd0 // MxNotificationPtrList::~MxNotificationPtrList +// TEMPLATE: BETA10 0x10129670 +// list >::empty + #endif // MXNOTIFICATIONMANAGER_H diff --git a/LEGO1/omni/src/main/mxomni.cpp b/LEGO1/omni/src/main/mxomni.cpp index c6c83733..29196431 100644 --- a/LEGO1/omni/src/main/mxomni.cpp +++ b/LEGO1/omni/src/main/mxomni.cpp @@ -188,12 +188,8 @@ void MxOmni::Destroy() DeleteObject(action); } - // TODO: private members if (m_notificationManager) { - while (m_notificationManager->GetQueue()) { - if (m_notificationManager->GetQueue()->size() == 0) { - break; - } + while (!m_notificationManager->IsEmpty()) { m_notificationManager->Tickle(); } @@ -211,7 +207,6 @@ void MxOmni::Destroy() delete m_notificationManager; delete m_tickleManager; - // There could be a tree/iterator function that does this inline if (m_atomSet) { while (m_atomSet->size() != 0) { // Pop each node and delete its value @@ -220,8 +215,10 @@ void MxOmni::Destroy() m_atomSet->erase(begin); delete value; } + delete m_atomSet; } + Init(); } diff --git a/LEGO1/omni/src/notify/mxnotificationmanager.cpp b/LEGO1/omni/src/notify/mxnotificationmanager.cpp index f9c00c3c..58c97e38 100644 --- a/LEGO1/omni/src/notify/mxnotificationmanager.cpp +++ b/LEGO1/omni/src/notify/mxnotificationmanager.cpp @@ -26,6 +26,7 @@ MxNotification::~MxNotification() } // FUNCTION: LEGO1 0x100ac250 +// FUNCTION: BETA10 0x10125805 MxNotificationManager::MxNotificationManager() : MxCore(), m_lock(), m_listenerIds() { m_unk0x2c = 0;