aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorColin Snover2017-11-16 23:56:13 -0600
committerEugene Sandulenko2017-11-18 22:35:12 +0100
commitbd07925134a3c29091ddd4a6df2f7cae80828ab0 (patch)
tree33300af252c8f28b605fbe3f355837ec2b78b5ce /engines/fullpipe
parent51b19e97c8d54d88e54cf7c88aca19d7b0962371 (diff)
downloadscummvm-rg350-bd07925134a3c29091ddd4a6df2f7cae80828ab0.tar.gz
scummvm-rg350-bd07925134a3c29091ddd4a6df2f7cae80828ab0.tar.bz2
scummvm-rg350-bd07925134a3c29091ddd4a6df2f7cae80828ab0.zip
FULLPIPE: Fix leaks of MessageQueues
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/behavior.cpp4
-rw-r--r--engines/fullpipe/messages.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp
index 2c0cba8f84..db91643fa5 100644
--- a/engines/fullpipe/behavior.cpp
+++ b/engines/fullpipe/behavior.cpp
@@ -173,7 +173,9 @@ void BehaviorManager::updateStaticAniBehavior(StaticANIObject &ani, int delay, c
if (mq) {
mq->setParamInt(-1, ani._odelay);
- mq->chain(&ani);
+ if (!mq->chain(&ani)) {
+ g_fp->_globalMessageQueueList->deleteQueueById(mq->_id);
+ }
}
}
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index db75146cb8..63d5c4d421 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -883,9 +883,8 @@ bool chainQueue(int queueId, int flags) {
nmq->_flags |= flags;
- if (!nmq->chain(0)) {
- delete nmq;
-
+ if (!nmq->chain(nullptr)) {
+ g_fp->_globalMessageQueueList->deleteQueueById(nmq->_id);
return false;
}
@@ -903,8 +902,7 @@ bool chainObjQueue(StaticANIObject *obj, int queueId, int flags) {
nmq->_flags |= flags;
if (!nmq->chain(obj)) {
- delete nmq;
-
+ g_fp->_globalMessageQueueList->deleteQueueById(nmq->_id);
return false;
}