From e39429ce4e219bd577f1adb2c98f04e614b57ceb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Dec 2012 21:09:49 +0300 Subject: Fix termination memory leaks after adding batch draw. --- src/gui/equipmentwindow.cpp | 2 ++ src/gui/widgets/shortcutcontainer.cpp | 6 ++++++ src/gui/widgets/shortcutcontainer.h | 3 +-- src/touchmanager.cpp | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index ef22dc4c5..eec7bba4c 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -139,6 +139,8 @@ EquipmentWindow::~EquipmentWindow() mSlotBackground->decRef(); if (mSlotHighlightedBackground) mSlotHighlightedBackground->decRef(); + delete mVertexes; + mVertexes = nullptr; } void EquipmentWindow::draw(gcn::Graphics *graphics) diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index c421a4bdb..eae6e3ff7 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -49,6 +49,12 @@ ShortcutContainer::ShortcutContainer() : { } +ShortcutContainer::~ShortcutContainer() +{ + delete mVertexes; + mVertexes = nullptr; +} + void ShortcutContainer::widgetResized(const gcn::Event &event A_UNUSED) { mGridWidth = getWidth() / mBoxWidth; diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index b331782fb..999da22d5 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -53,8 +53,7 @@ class ShortcutContainer : public gcn::Widget, /** * Destructor. */ - ~ShortcutContainer() - { } + ~ShortcutContainer(); /** * Draws the shortcuts diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index 3b8c6e21b..3a022afc3 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -48,6 +48,8 @@ TouchManager::TouchManager() : TouchManager::~TouchManager() { clear(); + delete mVertexes; + mVertexes = nullptr; } void TouchManager::init() -- cgit v1.2.3-70-g09d2