diff options
-rw-r--r-- | engines/fullpipe/behavior.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/messages.cpp | 8 |
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; } |