diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-02-07 17:10:39 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-02-07 17:10:39 -0700 |
commit | ed39c71b2b6b47931f352ca07b49f631d6bf713a (patch) | |
tree | b66630214ae3b84aa5e8cb910c2801b2a610012b /src/gui/widgets/listbox.cpp | |
parent | dca3a657c821925b6a3d6776e7cdcb35608989fe (diff) | |
download | mana-client-ed39c71b2b6b47931f352ca07b49f631d6bf713a.tar.gz mana-client-ed39c71b2b6b47931f352ca07b49f631d6bf713a.tar.bz2 mana-client-ed39c71b2b6b47931f352ca07b49f631d6bf713a.tar.xz mana-client-ed39c71b2b6b47931f352ca07b49f631d6bf713a.zip |
Cleanup some memory issues
Diffstat (limited to 'src/gui/widgets/listbox.cpp')
-rw-r--r-- | src/gui/widgets/listbox.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 7f96ad3e..e97f1d63 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -34,11 +34,20 @@ float ListBox::mAlpha = 1.0; -ListBox::ListBox(gcn::ListModel *listModel): - gcn::ListBox(listModel) +ListBox::ListBox(gcn::ListModel *listModel, bool deleteModel): + gcn::ListBox(listModel), + mDeleteModel(deleteModel) { } +ListBox::~ListBox() +{ + if (mDeleteModel) + { + delete mListModel; + } +} + void ListBox::updateAlpha() { float alpha = std::max(config.getValue("guialpha", 0.8), |