summarylogtreecommitdiffstats
path: root/poppler_fix.patch
blob: 21358e1d6b7884d124fbe772be9ec4d7ccff5ee3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/plug-ins/pdf/pdf-import.cpp b/plug-ins/pdf/pdf-import.cpp
index 15100bc6..c45cf452 100644
--- a/plug-ins/pdf/pdf-import.cpp
+++ b/plug-ins/pdf/pdf-import.cpp
@@ -857,7 +857,7 @@ extern "C"
 gboolean
 import_pdf(const gchar *filename, DiagramData *dia, DiaContext *ctx, void* user_data)
 {
-  PDFDoc *doc;
+  std::unique_ptr<PDFDoc> doc;
   GooString *fileName = new GooString(filename);
   // no passwords yet
   GooString *ownerPW = NULL;
@@ -889,7 +889,7 @@ import_pdf(const gchar *filename, DiagramData *dia, DiaContext *ctx, void* user_
     delete diaOut;
     ret = TRUE;
   }
-  delete doc;
+  doc.reset();
   delete fileName;
 
   return ret;