aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/messages.cpp
diff options
context:
space:
mode:
authorColin Snover2017-11-14 20:50:13 -0600
committerEugene Sandulenko2017-11-18 22:35:12 +0100
commit39ea2f66ac635613c3a817c16f80b11ac207d320 (patch)
tree73019faa52cec38173821559a2165d341eeb0b1e /engines/fullpipe/messages.cpp
parent073692fd5250ae6fb2224f791821c5bd225ba5f0 (diff)
downloadscummvm-rg350-39ea2f66ac635613c3a817c16f80b11ac207d320.tar.gz
scummvm-rg350-39ea2f66ac635613c3a817c16f80b11ac207d320.tar.bz2
scummvm-rg350-39ea2f66ac635613c3a817c16f80b11ac207d320.zip
FULLPIPE: Fix deleted queue leaks & clarify flags
Diffstat (limited to 'engines/fullpipe/messages.cpp')
-rw-r--r--engines/fullpipe/messages.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 111c70ce05..22a1fe7108 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -362,17 +362,16 @@ bool MessageQueue::load(MfcArchive &file) {
bool MessageQueue::chain(StaticANIObject *ani) {
if (checkGlobalExCommandList1() && checkGlobalExCommandList2()) {
- if (!(getFlags() & 2)) {
+ if (!(getFlags() & kInGlobalQueue)) {
g_fp->_globalMessageQueueList->addMessageQueue(this);
- _flags |= 2;
+ _flags |= kInGlobalQueue;
}
if (ani) {
ani->queueMessageQueue(this);
- return true;
} else {
sendNextCommand();
- return true;
}
+ return true;
}
return false;
}
@@ -653,8 +652,7 @@ MessageQueue *GlobalMessageQueueList::getMessageQueueById(int id) {
void GlobalMessageQueueList::deleteQueueById(int id) {
for (uint i = 0; i < size(); i++)
if (_storage[i]->_id == id) {
- remove_at(i);
-
+ delete remove_at(i);
disableQueueById(id);
return;
}
@@ -663,7 +661,7 @@ void GlobalMessageQueueList::deleteQueueById(int id) {
void GlobalMessageQueueList::removeQueueById(int id) {
for (uint i = 0; i < size(); i++)
if (_storage[i]->_id == id) {
- _storage[i]->_flags &= 0xFD; // It is quite pointless
+ _storage[i]->_flags &= ~kInGlobalQueue;
remove_at(i);
disableQueueById(id);
@@ -708,7 +706,7 @@ int GlobalMessageQueueList::compact() {
}
void GlobalMessageQueueList::addMessageQueue(MessageQueue *msg) {
- msg->setFlags(msg->getFlags() | 2);
+ msg->setFlags(msg->getFlags() | kInGlobalQueue);
push_back(msg);
}