Helper function for MxNotificationManager list

This commit is contained in:
disinvite 2024-05-07 12:26:36 -04:00
parent 61cd2714de
commit fa0907abe0
3 changed files with 12 additions and 6 deletions

View File

@ -47,8 +47,13 @@ class MxNotificationManager : public MxCore {
MxResult Send(MxCore* p_listener, const MxNotificationParam& p_param); MxResult Send(MxCore* p_listener, const MxNotificationParam& p_param);
inline MxNotificationPtrList* GetQueue() { return m_queue; } inline MxNotificationPtrList* GetQueue() { return m_queue; }
// FUNCTION: BETA10 0x10132270
inline void SetActive(MxBool p_active) { m_active = p_active; } 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 // SYNTHETIC: LEGO1 0x100ac390
// MxNotificationManager::`scalar deleting destructor' // MxNotificationManager::`scalar deleting destructor'
@ -86,4 +91,7 @@ class MxNotificationManager : public MxCore {
// SYNTHETIC: LEGO1 0x100accd0 // SYNTHETIC: LEGO1 0x100accd0
// MxNotificationPtrList::~MxNotificationPtrList // MxNotificationPtrList::~MxNotificationPtrList
// TEMPLATE: BETA10 0x10129670
// list<MxNotification *,allocator<MxNotification *> >::empty
#endif // MXNOTIFICATIONMANAGER_H #endif // MXNOTIFICATIONMANAGER_H

View File

@ -188,12 +188,8 @@ void MxOmni::Destroy()
DeleteObject(action); DeleteObject(action);
} }
// TODO: private members
if (m_notificationManager) { if (m_notificationManager) {
while (m_notificationManager->GetQueue()) { while (!m_notificationManager->IsEmpty()) {
if (m_notificationManager->GetQueue()->size() == 0) {
break;
}
m_notificationManager->Tickle(); m_notificationManager->Tickle();
} }
@ -211,7 +207,6 @@ void MxOmni::Destroy()
delete m_notificationManager; delete m_notificationManager;
delete m_tickleManager; delete m_tickleManager;
// There could be a tree/iterator function that does this inline
if (m_atomSet) { if (m_atomSet) {
while (m_atomSet->size() != 0) { while (m_atomSet->size() != 0) {
// Pop each node and delete its value // Pop each node and delete its value
@ -220,8 +215,10 @@ void MxOmni::Destroy()
m_atomSet->erase(begin); m_atomSet->erase(begin);
delete value; delete value;
} }
delete m_atomSet; delete m_atomSet;
} }
Init(); Init();
} }

View File

@ -26,6 +26,7 @@ MxNotification::~MxNotification()
} }
// FUNCTION: LEGO1 0x100ac250 // FUNCTION: LEGO1 0x100ac250
// FUNCTION: BETA10 0x10125805
MxNotificationManager::MxNotificationManager() : MxCore(), m_lock(), m_listenerIds() MxNotificationManager::MxNotificationManager() : MxCore(), m_lock(), m_listenerIds()
{ {
m_unk0x2c = 0; m_unk0x2c = 0;