diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-18 21:52:17 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-18 21:52:17 +0200 |
commit | 8766348bdc55e6aea795cbb765fadea08a70476c (patch) | |
tree | a8ed0cc70609c9924f9c1f2e56b75ca801f92af4 | |
parent | d9eea6e19d54c85a937b01f8a232e74e294a4697 (diff) | |
download | mana-8766348bdc55e6aea795cbb765fadea08a70476c.tar.gz mana-8766348bdc55e6aea795cbb765fadea08a70476c.tar.bz2 mana-8766348bdc55e6aea795cbb765fadea08a70476c.tar.xz mana-8766348bdc55e6aea795cbb765fadea08a70476c.zip |
Fixed progress bar crash
Sorry about that.
-rw-r--r-- | src/gui/widgets/progressbar.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 58f24651..c673ffb3 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -31,6 +31,8 @@ #include "resources/image.h" #include "resources/resourcemanager.h" +#include "utils/dtor.h" + #include <guichan/font.hpp> ImageRect ProgressBar::mBorder; @@ -59,7 +61,7 @@ ProgressBar::ProgressBar(float progress, mBorder.grid[1] = dBorders->getSubImage(4, 0, 3, 4); mBorder.grid[2] = dBorders->getSubImage(7, 0, 4, 4); mBorder.grid[3] = dBorders->getSubImage(0, 4, 4, 10); - mBorder.grid[4] = resman->getImage("graphics/gui/bg_quad_dis.png"); + mBorder.grid[4] = dBorders->getSubImage(4, 4, 3, 10); mBorder.grid[5] = dBorders->getSubImage(7, 4, 4, 10); mBorder.grid[6] = dBorders->getSubImage(0, 15, 4, 4); mBorder.grid[7] = dBorders->getSubImage(4, 15, 3, 4); @@ -82,15 +84,7 @@ ProgressBar::~ProgressBar() if (mInstances == 0) { - delete mBorder.grid[0]; - delete mBorder.grid[1]; - delete mBorder.grid[2]; - delete mBorder.grid[3]; - mBorder.grid[4]->decRef(); - delete mBorder.grid[5]; - delete mBorder.grid[6]; - delete mBorder.grid[7]; - delete mBorder.grid[8]; + for_each(mBorder.grid, mBorder.grid + 9, dtor<Image*>()); } } |