From a5e45cef061b921981012176ad7dc9cb5e03dacc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 5 Jul 2011 22:33:12 +0300 Subject: Fix memory leak in shop window, add missing initialisation to BeingCacheEntry. Small code style fix. --- src/gui/widgets/shopitems.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gui/widgets/shopitems.cpp') diff --git a/src/gui/widgets/shopitems.cpp b/src/gui/widgets/shopitems.cpp index 85ee0a181..c5bcd88c4 100644 --- a/src/gui/widgets/shopitems.cpp +++ b/src/gui/widgets/shopitems.cpp @@ -101,6 +101,16 @@ void ShopItems::erase(unsigned int i) mShopItems.erase(mShopItems.begin() + i); } +void ShopItems::del(unsigned int i) +{ + if (i >= mShopItems.size()) + return; + + ShopItem *item = *(mShopItems.begin() + i); + mShopItems.erase(mShopItems.begin() + i); + delete item; +} + void ShopItems::clear() { delete_all(mShopItems); -- cgit v1.2.3-60-g2f50