minor cleaning

This commit is contained in:
fluxgen 2002-11-14 10:12:42 +00:00
parent 7c24bf9b5a
commit d6ed5970a8

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Image.cc,v 1.16 2002/09/15 09:42:00 fluxgen Exp $ // $Id: Image.cc,v 1.17 2002/11/14 10:12:42 fluxgen Exp $
//use GNU extensions //use GNU extensions
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
@ -2288,23 +2288,24 @@ Pixmap BImageControl::renderImage(unsigned int width, unsigned int height,
void BImageControl::removeImage(Pixmap pixmap) { void BImageControl::removeImage(Pixmap pixmap) {
if (pixmap) { if (!pixmap)
CacheList::iterator it = cache.begin(); return;
CacheList::iterator it_end = cache.end();
for (; it != it_end; ++it) { CacheList::iterator it = cache.begin();
if ((*it)->pixmap == pixmap) { CacheList::iterator it_end = cache.end();
if ((*it)->count) { for (; it != it_end; ++it) {
(*it)->count--; if ((*it)->pixmap == pixmap) {
if ((*it)->count) {
(*it)->count--;
#ifdef TIMEDCACHE #ifdef TIMEDCACHE
timeout(); timeout();
#else // !TIMEDCACHE #else // !TIMEDCACHE
if (! (*it)->count) timeout(); if (! (*it)->count) timeout();
#endif // TIMEDCACHE #endif // TIMEDCACHE
}
return;
} }
return;
} }
} }
} }