mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-17 23:11:48 +00:00
Forwardport SVN commit 665684 by pino:
When getting the result of a pixmap request for an observer that went away in the meanwhile, don't create a memory entry for the pixmap, as we assume the allocated pixmaps fifo holds only descriptors for valid observers. (fixed KPDF #143951) svn path=/trunk/KDE/kdegraphics/okular/; revision=665685
This commit is contained in:
parent
3bd28d1fbb
commit
c4ea50c99b
|
@ -2268,16 +2268,22 @@ void Document::requestDone( PixmapRequest * req )
|
|||
break;
|
||||
}
|
||||
|
||||
// [MEM] 1.2 append memory allocation descriptor to the FIFO
|
||||
int memoryBytes = 4 * req->width() * req->height();
|
||||
AllocatedPixmap * memoryPage = new AllocatedPixmap( req->id(), req->pageNumber(), memoryBytes );
|
||||
d->m_allocatedPixmapsFifo.append( memoryPage );
|
||||
d->m_allocatedPixmapsTotalMemory += memoryBytes;
|
||||
|
||||
// 2. notify an observer that its pixmap changed
|
||||
QMap< int, DocumentObserver * >::const_iterator itObserver = d->m_observers.constFind( req->id() );
|
||||
if ( itObserver != d->m_observers.constEnd() )
|
||||
{
|
||||
// [MEM] 1.2 append memory allocation descriptor to the FIFO
|
||||
int memoryBytes = 4 * req->width() * req->height();
|
||||
AllocatedPixmap * memoryPage = new AllocatedPixmap( req->id(), req->pageNumber(), memoryBytes );
|
||||
d->m_allocatedPixmapsFifo.append( memoryPage );
|
||||
d->m_allocatedPixmapsTotalMemory += memoryBytes;
|
||||
|
||||
// 2. notify an observer that its pixmap changed
|
||||
itObserver.value()->notifyPageChanged( req->pageNumber(), DocumentObserver::Pixmap );
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
else
|
||||
kWarning() << "Receiving a done request for the defunct observer " << req->id() << endl;
|
||||
#endif
|
||||
|
||||
// 3. delete request
|
||||
delete req;
|
||||
|
|
Loading…
Reference in a new issue