diff options
author | mathias <mathias> | 2005-01-02 06:21:45 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-01-02 06:21:45 (GMT) |
commit | c7a3200730b3e2948cab3fdb43a786cb1b2f60f1 (patch) | |
tree | 576fefda18c682caac8c79a7f8edd04c4c27c961 | |
parent | 1be23b544f929e03484b620b0ea917407f0f2ec3 (diff) | |
download | fluxbox_lack-c7a3200730b3e2948cab3fdb43a786cb1b2f60f1.zip fluxbox_lack-c7a3200730b3e2948cab3fdb43a786cb1b2f60f1.tar.bz2 |
small issues:
- added a guard so no invalid(0)-handler is deleted at shutdown
- "if (s_image_map[extension] == 0)" -> creates an entry for sure, we
dont want this.
-rw-r--r-- | src/FbTk/Image.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/FbTk/Image.cc b/src/FbTk/Image.cc index a7ff7e5..bc08c6c 100644 --- a/src/FbTk/Image.cc +++ b/src/FbTk/Image.cc | |||
@@ -66,8 +66,10 @@ void Image::shutdown() { | |||
66 | // for more than one type | 66 | // for more than one type |
67 | ImageMap::iterator it = s_image_map.begin(); | 67 | ImageMap::iterator it = s_image_map.begin(); |
68 | ImageMap::iterator it_end = s_image_map.end(); | 68 | ImageMap::iterator it_end = s_image_map.end(); |
69 | for (; it != it_end; it++) | 69 | for (; it != it_end; it++) { |
70 | handlers.insert(it->second); | 70 | if (it->second) |
71 | handlers.insert(it->second); | ||
72 | } | ||
71 | 73 | ||
72 | // free the unique handlers | 74 | // free the unique handlers |
73 | std::set<ImageBase*>::iterator handler_it = handlers.begin(); | 75 | std::set<ImageBase*>::iterator handler_it = handlers.begin(); |
@@ -87,9 +89,9 @@ PixmapWithMask *Image::load(const std::string &filename, int screen_num) { | |||
87 | 89 | ||
88 | // determine file ending | 90 | // determine file ending |
89 | std::string extension(StringUtil::toUpper(StringUtil::findExtension(filename))); | 91 | std::string extension(StringUtil::toUpper(StringUtil::findExtension(filename))); |
90 | 92 | ||
91 | // valid handle? | 93 | // valid handle? |
92 | if (s_image_map[extension] == 0) | 94 | if (s_image_map.find(extension) == s_image_map.end()) |
93 | return false; | 95 | return false; |
94 | 96 | ||
95 | // load file | 97 | // load file |