diff options
author | Albert Astals Cid <aacid@kde.org> | 2008-11-05 19:52:00 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2008-11-05 19:52:00 +0100 |
commit | fc61dad9daa15f83802ffa5c3cd9b59d80bb310b (patch) | |
tree | 01fb4bcae1c768c824b40f09e54e76e448182da8 /qt | |
parent | 981fb857b0afb1cda7836744dcf37906285512b4 (diff) |
[Qt] Fix leak
Diffstat (limited to 'qt')
-rw-r--r-- | qt/poppler-link.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/qt/poppler-link.cc b/qt/poppler-link.cc index deef9a47..1be74378 100644 --- a/qt/poppler-link.cc +++ b/qt/poppler-link.cc @@ -1,5 +1,5 @@ /* poppler-link.cc: qt interface to poppler - * Copyright (C) 2006, Albert Astals Cid + * Copyright (C) 2006, 2008 Albert Astals Cid * Adapting code from * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> * @@ -29,10 +29,14 @@ namespace Poppler { LinkDestination::LinkDestination(const LinkDestinationData &data) { + bool deleteDest = false; LinkDest *ld = data.ld; if ( data.namedDest && !ld ) + { + deleteDest = true; ld = data.doc->doc.findDest( data.namedDest ); + } if (!ld) return; @@ -72,6 +76,8 @@ namespace Poppler { m_top = topAux; m_right = rightAux; m_bottom = bottomAux; + + if (deleteDest) delete ld; } LinkDestination::LinkDestination(const QString &description) |