diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-09-02 19:14:08 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-09-04 10:32:53 -0600 |
commit | 49452a005f4273b3ec91470883f308690e2269ac (patch) | |
tree | 48696ade4f99449959dd5cf0f023ba179a7e6f0a | |
parent | e806e70958f68a3b0dc9c841cacabacf011ac973 (diff) | |
download | mana-49452a005f4273b3ec91470883f308690e2269ac.tar.gz mana-49452a005f4273b3ec91470883f308690e2269ac.tar.bz2 mana-49452a005f4273b3ec91470883f308690e2269ac.tar.xz mana-49452a005f4273b3ec91470883f308690e2269ac.zip |
Fix crash with missing skill icon
Reviewed-by: Bertram
-rw-r--r-- | src/gui/skilldialog.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 53528cee..207e3ded 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -73,9 +73,14 @@ struct SkillInfo float progress; gcn::Color color; + SkillInfo() : + icon(NULL) + {} + ~SkillInfo() { - icon->decRef(); + if (icon) + icon->decRef(); } void setIcon(const std::string &iconPath) @@ -85,7 +90,8 @@ struct SkillInfo { icon = res->getImage(iconPath); } - else + + if (!icon) { icon = Theme::getImageFromTheme("unknown-item.png"); } |