Fixing some memory leaks in the GUI code

svn-id: r26515
This commit is contained in:
Max Horn 2007-04-15 19:03:25 +00:00
parent aecd100f93
commit f8067d54e5
5 changed files with 2 additions and 8 deletions

View File

@ -71,6 +71,7 @@ void TabWidget::init() {
}
TabWidget::~TabWidget() {
_firstWidget = 0;
for (uint i = 0; i < _tabs.size(); ++i) {
delete _tabs[i].firstWidget;
_tabs[i].firstWidget = 0;

View File

@ -65,11 +65,6 @@ Dialog::Dialog(const Common::String &name, bool dimsInactive_)
}
}
Dialog::~Dialog() {
delete _firstWidget;
_firstWidget = 0;
}
int Dialog::runModal() {
// Open up
open();

View File

@ -54,7 +54,6 @@ private:
public:
Dialog(int x, int y, int w, int h, bool dimsInactive = true);
Dialog(const Common::String &name, bool dimsInactive = true);
virtual ~Dialog();
virtual int runModal();

View File

@ -31,10 +31,8 @@ GuiObject::GuiObject(const Common::String &name) : _firstWidget(0) {
}
GuiObject::~GuiObject() {
/* TODO: Enable this at some point? Right now it causes crashes
delete _firstWidget;
_firstWidget = 0;
*/
}
uint32 GuiObject::getMillis() {

View File

@ -58,6 +58,7 @@ void Widget::resize(int x, int y, int w, int h) {
Widget::~Widget() {
delete _next;
_next = 0;
}
void Widget::draw() {