Code

Another take to fixing pdf import crash, likely without memory leak
authorkiirala <kiirala@users.sourceforge.net>
Wed, 9 Jan 2008 22:58:38 +0000 (22:58 +0000)
committerkiirala <kiirala@users.sourceforge.net>
Wed, 9 Jan 2008 22:58:38 +0000 (22:58 +0000)
src/extension/internal/pdfinput/pdf-input.cpp

index 31364f61e2b8ab1cc940bdaaccb5543675d6bfce..fbb94ca8ccd375f105b9fdfb2eb5b81b7c6c7da3 100644 (file)
@@ -583,7 +583,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
 #ifndef WIN32
     GooString *filename_goo = new GooString(uri);
     PDFDoc *pdf_doc = new PDFDoc(filename_goo, NULL, NULL, NULL);   // TODO: Could ask for password
-    delete filename_goo;
+    //delete filename_goo;
 #else
     wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (uri, -1, NULL, NULL, NULL);
 
@@ -627,7 +627,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
     PdfImportDialog *dlg = new PdfImportDialog(pdf_doc, uri);
     if (!dlg->showDialog()) {
         delete dlg;
-        //delete pdf_doc;
+        delete pdf_doc;
 
         return NULL;
     }
@@ -708,7 +708,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
     delete pdf_parser;
     delete builder;
     g_free(docname);
-    //delete pdf_doc;
+    delete pdf_doc;
 
     // Restore undo
     sp_document_set_undo_sensitive(doc, saved);