From ae1f4efeb58d195acde7185fa4f71100449966be Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Thu, 18 Jul 2019 21:13:10 +0530 Subject: HDB: Fix memory leaks in Menu --- engines/hdb/menu.cpp | 15 +++++++++++++++ engines/hdb/window.cpp | 2 ++ 2 files changed, 17 insertions(+) diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp index ffcf673723..8d82283623 100644 --- a/engines/hdb/menu.cpp +++ b/engines/hdb/menu.cpp @@ -27,6 +27,21 @@ namespace HDB { Menu::~Menu() { freeMenu(); + + delete _gCheckEmpty; + delete _gCheckOff; + delete _gCheckOn; + delete _gCheckLeft; + delete _gCheckRight; + + delete _contArrowUp; + delete _contArrowDown; + delete _contArrowLeft; + delete _contArrowRight; + delete _contAssign; + + delete _warpPlaque; + delete _hdbLogoScreen; } bool Menu::init() { diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp index b3e4b1963b..28faa21025 100644 --- a/engines/hdb/window.cpp +++ b/engines/hdb/window.cpp @@ -418,6 +418,8 @@ void Window::restartSystem() { _dialogChoiceInfo.active = false; _invWinInfo.active = false; _dialogDelay = _invWinInfo.selection = 0; + if (_gemGfx) + delete _gemGfx; _gemGfx = g_hdb->_gfx->loadTile(GEM_WHITE_GFX); _infobarDimmed = 0; } -- cgit v1.2.3