[dia] pdf-import: Use a unique_ptr for the created PDFDoc
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] pdf-import: Use a unique_ptr for the created PDFDoc
- Date: Fri, 13 May 2022 23:31:04 +0000 (UTC)
commit e67d2a7605538bf60e551ad4ac3e57a277676a0a
Author: Guillaume Poirier-Morency <guillaumepoiriermorency gmail com>
Date: Sat Apr 9 10:07:29 2022 -0700
pdf-import: Use a unique_ptr for the created PDFDoc
plug-ins/pdf/pdf-import.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/plug-ins/pdf/pdf-import.cpp b/plug-ins/pdf/pdf-import.cpp
index d3977c33f..189737908 100644
--- a/plug-ins/pdf/pdf-import.cpp
+++ b/plug-ins/pdf/pdf-import.cpp
@@ -867,7 +867,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;
@@ -899,7 +899,6 @@ import_pdf(const gchar *filename, DiagramData *dia, DiaContext *ctx, void* user_
delete diaOut;
ret = TRUE;
}
- delete doc;
delete fileName;
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]