mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-13 13:11:41 +00:00
FIX: Delete allocation descriptors when dynamic observers are removed.
BUG:98091 svn path=/trunk/kdegraphics/kpdf/; revision=383357
This commit is contained in:
parent
1efaf05d25
commit
fd0606adb2
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue