[KPhotoAlbum] PATCH: remove some ImageRequest memory leaks

Henner Zeller h.zeller at acm.org
Tue May 1 01:37:40 CEST 2007

While looking into the ImageManager (with the help of the LeakTracer
[1]), I found some memory leaks that add up over time: ImageRequests
were not deleted in certain circumstances:
  - when adding a request that already is in the queue:
  - cancelled requests: RequestQueue::cancelRequests()
  - requests that are just the same as the one currently loading and
thus are discarded Manager::loadImage()

In the course of that, I did some small re-arrangements of code in the
ImageManager::Manager and fixed what I believe is a bug in

  -    if ( _currentLoading && *_currentLoading == *request &&
_loadList.isRequestStillValid( request ))
  +    if ( _currentLoading && *_currentLoading == *request &&
_loadList.isRequestStillValid( _currentLoading ))

The list was checked if the just passed request was in there (which it
isn't of couse) instead of the _currentLoading one.

As usual to be found here:


[1] http://www.andreasen.org/LeakTracer/

More information about the KPhotoAlbum mailing list