LAB: Avoid memory leaks with fonts

This commit is contained in:
Strangerke 2015-12-19 13:08:54 +01:00 committed by Willem Jan Palenstijn
parent 7f5826cfcb
commit 3fcd3c1526
5 changed files with 21 additions and 14 deletions

View file

@ -1124,6 +1124,9 @@ void LabEngine::go() {
_graphics->setUpScreens();
_event->initMouse();
if (_msgFont)
_graphics->closeFont(&_msgFont);
if (getPlatform() != Common::kPlatformAmiga)
_msgFont = _resource->getFont("F:AvanteG.12");
else
@ -1137,7 +1140,7 @@ void LabEngine::go() {
_event->mouseShow();
mainGameLoop();
_graphics->closeFont(_msgFont);
_graphics->closeFont(&_msgFont);
_graphics->freePict();
freeScreens();