Commit fd0606ad authored by Enrico Ros's avatar Enrico Ros

FIX: Delete allocation descriptors when dynamic observers are removed.

BUG:98091

svn path=/trunk/kdegraphics/kpdf/; revision=383357
parent 1efaf05d
......@@ -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 );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment