diff options
-rw-r--r-- | engines/lab/dispman.cpp | 5 | ||||
-rw-r--r-- | engines/lab/tilepuzzle.cpp | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index 0f2bc933e8..e9736a9bf3 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -853,7 +853,10 @@ void DisplayMan::doTransWipe(CloseDataPtr *closePtrList, const Common::String fi } // for i } // for j - delete[] bitMapBuffer; + // Prevent the Image destructor from deleting the drawing buffer + imDest._imageData = nullptr; + + // bitMapBuffer will be deleted by the Image destructor } void DisplayMan::doTransition(TransitionType transitionType, CloseDataPtr *closePtrList, const Common::String filename) { diff --git a/engines/lab/tilepuzzle.cpp b/engines/lab/tilepuzzle.cpp index d39612d49a..bea2b61ec4 100644 --- a/engines/lab/tilepuzzle.cpp +++ b/engines/lab/tilepuzzle.cpp @@ -327,6 +327,9 @@ void TilePuzzle::changeCombination(uint16 number) { _numberImages[combnum]->blitBitmap(0, (_numberImages[combnum])->_height - (2 * i), &(display), _vm->_utils->vgaScaleX(COMBINATION_X[number]), _vm->_utils->vgaScaleY(65), (_numberImages[combnum])->_width, 2, false); } + // Prevent the Image destructor from deleting the display buffer + display._imageData = nullptr; + delete[] buffer; bool unlocked = true; |