diff options
author | David Turner | 2011-01-20 22:32:30 +0000 |
---|---|---|
committer | David Turner | 2011-01-20 22:32:30 +0000 |
commit | 6412b1d2c70bd6a611ad1bfdac8437b9adc38738 (patch) | |
tree | 635b347b69e4d01c484bbd7c08969f842f47bf66 | |
parent | 5a7e25a3a64b4f383c4e0d585c82e1dee8297658 (diff) | |
download | scummvm-rg350-6412b1d2c70bd6a611ad1bfdac8437b9adc38738.tar.gz scummvm-rg350-6412b1d2c70bd6a611ad1bfdac8437b9adc38738.tar.bz2 scummvm-rg350-6412b1d2c70bd6a611ad1bfdac8437b9adc38738.zip |
GUI: Fix Memory Leak from PicButtonWidget _gfx Member.
This widget is only currently used by Hugo.
svn-id: r55364
-rw-r--r-- | gui/widget.cpp | 4 | ||||
-rw-r--r-- | gui/widget.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp index 3f75c973d4..6b6163232f 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -318,6 +318,10 @@ PicButtonWidget::PicButtonWidget(GuiObject *boss, const Common::String &name, co _type = kButtonWidget; } +PicButtonWidget::~PicButtonWidget() { + _gfx.free(); +} + void PicButtonWidget::handleMouseUp(int x, int y, int button, int clickCount) { if (isEnabled() && x >= 0 && x < _w && y >= 0 && y < _h) sendCommand(_cmd, 0); diff --git a/gui/widget.h b/gui/widget.h index 544b9c7601..1bb9823fdf 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -207,6 +207,7 @@ protected: public: PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0); PicButtonWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0); + ~PicButtonWidget(); void setCmd(uint32 cmd) { _cmd = cmd; } uint32 getCmd() const { return _cmd; } |