mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-05 23:49:20 +00:00
Don't leak memory
svn path=/trunk/playground/graphics/okular/; revision=622789
This commit is contained in:
parent
26f4618ae3
commit
21c42d89c7
7
part.cpp
7
part.cpp
|
@ -93,6 +93,8 @@ Part::Part(QWidget *parentWidget,
|
|||
// load catalog for translation
|
||||
KGlobal::locale()->insertCatalog("okular");
|
||||
|
||||
m_tempfile= 0L;
|
||||
|
||||
// create browser extension (for printing when embedded into browser)
|
||||
m_bExtension = new BrowserExtension(this);
|
||||
|
||||
|
@ -419,6 +421,9 @@ Part::~Part()
|
|||
QHash<QString, Okular::Generator*>::iterator it = m_loadedGenerators.begin(), itEnd = m_loadedGenerators.end();
|
||||
for ( ; it != itEnd; ++it )
|
||||
delete *it;
|
||||
|
||||
if (m_tempfile)
|
||||
delete m_tempfile;
|
||||
}
|
||||
|
||||
bool Part::openDocument(const KUrl& url, uint page)
|
||||
|
@ -1397,7 +1402,7 @@ bool Part::handleCompressed(KUrl & url, const QString &path, const KMimeType::Pt
|
|||
|
||||
// we are working with a compressed file, decompressing
|
||||
// temporary file for decompressing
|
||||
KTemporaryFile *m_tempfile = new KTemporaryFile;
|
||||
m_tempfile = new KTemporaryFile;
|
||||
if ( !m_tempfile )
|
||||
{
|
||||
KMessageBox::error( 0,
|
||||
|
|
2
part.h
2
part.h
|
@ -40,6 +40,7 @@ class KToggleFullScreenAction;
|
|||
class KSelectAction;
|
||||
class KAboutData;
|
||||
class KPrinter;
|
||||
class KTemporaryFile;
|
||||
|
||||
class ThumbnailList;
|
||||
class ThumbnailController;
|
||||
|
@ -155,6 +156,7 @@ private:
|
|||
void doPrint( KPrinter& printer );
|
||||
void fillGenerators();
|
||||
bool handleCompressed(KUrl & url, const QString &path, const KMimeType::Ptr mimetype);
|
||||
KTemporaryFile *m_tempfile;
|
||||
|
||||
// the document
|
||||
Okular::Document * m_document;
|
||||
|
|
Loading…
Reference in a new issue