summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Sander <oliver.sander@tu-dresden.de>2019-11-22 14:32:44 +0100
committerAlbert Astals Cid <tsdgeos@yahoo.es>2020-02-26 21:35:54 +0000
commit35b7e926035c7d6852ed148b4dbe6d15e32f3fed (patch)
tree0a209f03fbd342c47d3ddb19cd0de632f08c7cfb
parenta11fc679a701879ffd8ba6ccbd4b0a08a03440e6 (diff)
Revert "pdfinfo: Fix another leak"
This reverts commit 4d799cdf9b9039b003de7d3baf05d858bc507a5a. When closing/deallocating a document, poppler should free all memory used by that document internally. Freeing some of that memory within pdfinfo is not a proper solution when valgrind shows leaks.
-rw-r--r--utils/JSInfo.cc14
-rw-r--r--utils/JSInfo.h4
2 files changed, 8 insertions, 10 deletions
diff --git a/utils/JSInfo.cc b/utils/JSInfo.cc
index b0869f09..f816c117 100644
--- a/utils/JSInfo.cc
+++ b/utils/JSInfo.cc
@@ -5,7 +5,7 @@
// This file is licensed under the GPLv2 or later
//
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
-// Copyright (C) 2016, 2017, 2020 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2017, 2020 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
// Copyright (C) 2020 Oliver Sander <oliver.sander@tu-dresden.de>
//
@@ -52,7 +52,7 @@ void JSInfo::printJS(const GooString *js) {
gfree(u);
}
-void JSInfo::scanLinkAction(LinkAction *link, const char *action, bool deleteLink) {
+void JSInfo::scanLinkAction(LinkAction *link, const char *action) {
if (!link)
return;
@@ -82,8 +82,6 @@ void JSInfo::scanLinkAction(LinkAction *link, const char *action, bool deleteLin
}
}
}
- if (deleteLink)
- delete link;
}
void JSInfo::scanJS(int nPages) {
@@ -141,7 +139,7 @@ void JSInfo::scan(int nPages) {
for (int j = 0; j < field->getNumWidgets(); j++) {
FormWidget *widget = field->getWidget(j);
scanLinkAction(widget->getActivationAction(),
- "Field Activated", false);
+ "Field Activated");
scanLinkAction(widget->getAdditionalAction(Annot::actionFieldModified),
"Field Modified");
scanLinkAction(widget->getAdditionalAction(Annot::actionFormatField),
@@ -178,11 +176,11 @@ void JSInfo::scan(int nPages) {
for (int i = 0; i < annots->getNumAnnots(); ++i) {
if (annots->getAnnot(i)->getType() == Annot::typeLink) {
AnnotLink *annot = static_cast<AnnotLink *>(annots->getAnnot(i));
- scanLinkAction(annot->getAction(), "Link Annotation Activated", false);
+ scanLinkAction(annot->getAction(), "Link Annotation Activated");
} else if (annots->getAnnot(i)->getType() == Annot::typeScreen) {
AnnotScreen *annot = static_cast<AnnotScreen *>(annots->getAnnot(i));
scanLinkAction(annot->getAction(),
- "Screen Annotation Activated", false);
+ "Screen Annotation Activated");
scanLinkAction(annot->getAdditionalAction(Annot::actionCursorEntering),
"Screen Annotation Cursor Enter");
scanLinkAction(annot->getAdditionalAction(Annot::actionCursorLeaving),
@@ -207,7 +205,7 @@ void JSInfo::scan(int nPages) {
} else if (annots->getAnnot(i)->getType() == Annot::typeWidget) {
AnnotWidget *annot = static_cast<AnnotWidget *>(annots->getAnnot(i));
scanLinkAction(annot->getAction(),
- "Widget Annotation Activated", false);
+ "Widget Annotation Activated");
scanLinkAction(annot->getAdditionalAction(Annot::actionCursorEntering),
"Widget Annotation Cursor Enter");
scanLinkAction(annot->getAdditionalAction(Annot::actionCursorLeaving),
diff --git a/utils/JSInfo.h b/utils/JSInfo.h
index 58dbd68d..646d623d 100644
--- a/utils/JSInfo.h
+++ b/utils/JSInfo.h
@@ -5,7 +5,7 @@
// This file is licensed under the GPLv2 or later
//
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
-// Copyright (C) 2016, 2020 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2020 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
//
// To see a description of the changes please see the Changelog file that
@@ -53,7 +53,7 @@ private:
const UnicodeMap *uniMap;
void scan(int nPages);
- void scanLinkAction(LinkAction *link, const char *action, bool deleteLink = true);
+ void scanLinkAction(LinkAction *link, const char *action);
void printJS(const GooString *js);
};