From d05b238a3c100ed0b5b31093f3d15bb039dde8d6 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Wed, 4 Feb 2009 16:03:18 -0700 Subject: Added destructors to some classes originally obtained from Legends of Mazzeroth. At the moment, I think this is the last of the missing pointer deletes, but if more are found, then I'll add them to the proper classes and delete them. Signed-off-by: Ira Rice --- src/gui/itempopup.cpp | 11 +++++++++++ src/gui/itempopup.h | 1 + src/gui/speechbubble.cpp | 7 +++++++ src/gui/speechbubble.h | 1 + 4 files changed, 20 insertions(+) diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index 39a5ecf1..8651ede6 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -90,6 +90,17 @@ ItemPopup::ItemPopup(): setLocationRelativeTo(getParent()); } +ItemPopup::~ItemPopup() +{ + delete mItemName; + delete mItemDesc; + delete mItemDescScroll; + delete mItemEffect; + delete mItemEffectScroll; + delete mItemWeight; + delete mItemWeightScroll; +} + void ItemPopup::setItem(const ItemInfo &item) { mItemName->setCaption(item.getName()); diff --git a/src/gui/itempopup.h b/src/gui/itempopup.h index d9d37264..95ab6ffa 100644 --- a/src/gui/itempopup.h +++ b/src/gui/itempopup.h @@ -33,6 +33,7 @@ class ItemPopup : public Window { public: ItemPopup(); + ~ItemPopup(); void setItem(const ItemInfo &item); unsigned int getNumRows(); diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp index f14dcd52..f8c69e87 100644 --- a/src/gui/speechbubble.cpp +++ b/src/gui/speechbubble.cpp @@ -60,6 +60,13 @@ SpeechBubble::SpeechBubble(): setLocationRelativeTo(getParent()); } +SpeechBubble::~SpeechBubble() +{ + delete mCaption; + delete mSpeechBox; + delete mSpeechArea; +} + void SpeechBubble::setCaption(const std::string &name, const gcn::Color &color) { mCaption->setCaption(name); diff --git a/src/gui/speechbubble.h b/src/gui/speechbubble.h index 323e5cbb..7f5818af 100644 --- a/src/gui/speechbubble.h +++ b/src/gui/speechbubble.h @@ -33,6 +33,7 @@ class SpeechBubble : public Window public: SpeechBubble(); + ~SpeechBubble(); void setCaption(const std::string &name, const gcn::Color &color = 0x000000); -- cgit v1.2.3-70-g09d2