ImageCache class

Pablo d'Angelo pablo at mathematik.uni-ulm.de
Sat Aug 23 11:19:16 BST 2003


Hi developers,

currently the ImageCache class cannot remove images from its cache,
probably leading to memory problems for bigger projects. (I'm thinking
of my panos made from 20 pics or so...)

therefore the ImageCache class should check how much memory it consumes
and then remove pictures from the cache, depending how much RAM is still
available. I will probably use a simple "remove the olded" strategy.

This check could be done on every image request to image cache.
We just need to guarantee that we do not delete pictures that are still
in use by other classes. Therefore the image cache needs a reference
count that tells if the image is still in use.

A while ago I tried to implement a reference counting with proxy
objects, but it became quite messy.

Kai-Uwe, do you keep the wxImage* returned by ImageCache? If
there are places that need them across multiple functions then I would
have to implement the reference counting.

Otherwise I can skip this issue and just remove pics from the cache :)

ciao
  Pablo
--
http://wurm.wohnheim.uni-ulm.de/~redman/
Please use PGP


More information about the ptX mailing list