LAB: Prevent the Image destructor from deleting the drawing buffer

This commit is contained in:
Filippos Karapetis 2015-12-24 01:31:55 +02:00
parent 7a7a25c91d
commit 6f6c92d470
2 changed files with 7 additions and 1 deletions

View File

@ -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) {

View File

@ -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;