FIX: Delete allocation descriptors when dynamic observers are removed.

BUG:98091

svn path=/trunk/kdegraphics/kpdf/; revision=383357
This commit is contained in:
Enrico Ros 2005-01-28 18:18:48 +00:00
parent 1efaf05d25
commit fd0606adb2

View file

@ -244,6 +244,21 @@ void KPDFDocument::removeObserver( DocumentObserver * pObserver )
for ( ; it != end; ++it )
(*it)->deletePixmap( observerId );
// [MEM] free observer's allocation descriptors
QValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
QValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
while ( aIt != aEnd )
{
AllocatedPixmap * p = *aIt;
if ( p->id == observerId )
{
aIt = d->allocatedPixmapsFifo.remove( aIt );
delete p;
}
else
++aIt;
}
// delete observer entry from the map
d->observers.remove( observerId );
}