Commit 7ab451aa authored by Albert Astals Cid's avatar Albert Astals Cid

some leaks less

svn path=/branches/work/kde4/playground/graphics/okular/; revision=540485
parent 8f9801ed
......@@ -119,6 +119,7 @@ KPDFDocument::KPDFDocument( QHash<QString, Generator*> * genList )
d->memCheckTimer = 0;
d->saveBookmarksTimer = 0;
d->warnedOutOfMemory = false;
m_usingCachedGenerator = false;
}
KPDFDocument::~KPDFDocument()
......
/***************************** **********************************************
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
/***************************************************************************
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -298,6 +298,7 @@ void PDFGenerator::loadPages(QVector<KPDFPage*> &pagesVector, int rotation, bool
docLock.unlock();
page->setSearchPage(abstractTextPage(textList, page->height(), page->width(), rotation));
qDeleteAll(textList);
delete p;
if (clear && pagesVector[i])
......@@ -563,7 +564,9 @@ void PDFGenerator::generatePixmap( PixmapRequest * request )
docLock.unlock();
if ( genTextPage )
{
page->setSearchPage( abstractTextPage(p->textList(), page->height(), page->width(),page->rotation()) );
QList<Poppler::TextBox*> textList = p->textList();
page->setSearchPage( abstractTextPage(textList, page->height(), page->width(),page->rotation()) );
qDeleteAll(textList);
}
delete p;
......@@ -589,6 +592,7 @@ void PDFGenerator::generateSyncTextPage( KPDFPage * page )
delete pp;
// ..and attach it to the page
page->setSearchPage( abstractTextPage(textList, page->height(), page->width(),page->rotation()) );
qDeleteAll(textList);
}
bool PDFGenerator::print( KPrinter& printer )
......@@ -696,7 +700,6 @@ inline void append (KPDFTextPage* ktp,
));
}
// TODO have a look at who should delete what's inside text
KPDFTextPage * PDFGenerator::abstractTextPage(const QList<Poppler::TextBox*> &text, double height, double width,int rot)
{
KPDFTextPage* ktp=new KPDFTextPage;
......@@ -981,8 +984,11 @@ void PDFGenerator::threadFinished()
request->page->setPixmap( request->id, new QPixmap( *outImage ) );
delete outImage;
if ( !outText.isEmpty() )
{
request->page->setSearchPage( abstractTextPage( outText ,
request->page->height(), request->page->width(),request->page->rotation()));
qDeleteAll(outText);
}
bool genObjectRects = request->id & (PAGEVIEW_ID | PRESENTATION_ID);
if (genObjectRects) request->page->setObjectRects( outRects );
......
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