summaryrefslogtreecommitdiff
path: root/src/gui/widgets/shopitems.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-05 22:33:12 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-05 22:33:12 +0300
commita5e45cef061b921981012176ad7dc9cb5e03dacc (patch)
tree80780eec88ab13b2a05269f70fc84bf3a67780ce /src/gui/widgets/shopitems.cpp
parent710a37891458aaa3b924286950250500fb7b3fc3 (diff)
downloadplus-a5e45cef061b921981012176ad7dc9cb5e03dacc.tar.gz
plus-a5e45cef061b921981012176ad7dc9cb5e03dacc.tar.bz2
plus-a5e45cef061b921981012176ad7dc9cb5e03dacc.tar.xz
plus-a5e45cef061b921981012176ad7dc9cb5e03dacc.zip
Fix memory leak in shop window, add missing initialisation to BeingCacheEntry.
Small code style fix.
Diffstat (limited to 'src/gui/widgets/shopitems.cpp')
-rw-r--r--src/gui/widgets/shopitems.cpp10
1 files changed, 10 insertions, 0 deletions
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);