From: Owen Taylor Date: Wed, 22 Dec 2004 03:23:47 +0000 (+0000) Subject: PDFDoc constructor assumes ownership of the string passed in. X-Git-Tag: EVINCE_0_1_0~106 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=484bd6fc379965a3ad83e758135691d84d595f87;p=evince.git PDFDoc constructor assumes ownership of the string passed in. Tue Dec 21 22:17:04 2004 Owen Taylor * pdf/xpdf/pdf-document.cc (pdf_document_load): PDFDoc constructor assumes ownership of the string passed in. * shell/ev-window.c (ev_window_open): Destroy the error dialog once we've displayed it. --- diff --git a/ChangeLog b/ChangeLog index 48320e8a..11c2b459 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Dec 21 22:17:04 2004 Owen Taylor + + * pdf/xpdf/pdf-document.cc (pdf_document_load): PDFDoc + constructor assumes ownership of the string passed in. + + * shell/ev-window.c (ev_window_open): Destroy the error + dialog once we've displayed it. + Tue Dec 21 21:58:56 2004 Owen Taylor * pdf/xpdf/pdf-document.cc shell/ev-view.c: Hook things up diff --git a/pdf/xpdf/pdf-document.cc b/pdf/xpdf/pdf-document.cc index 6078f962..8558c822 100644 --- a/pdf/xpdf/pdf-document.cc +++ b/pdf/xpdf/pdf-document.cc @@ -78,11 +78,9 @@ pdf_document_load (EvDocument *document, filename_g = new GString (filename); g_free (filename); - // open the PDF file + // open the PDF file, assumes ownership of filename_g newDoc = new PDFDoc(filename_g, 0, 0); - delete filename_g; - if (!newDoc->isOk()) { err = newDoc->getErrorCode(); delete newDoc; diff --git a/shell/ev-window.c b/shell/ev-window.c index d04dd910..72fc6272 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -177,6 +177,7 @@ ev_window_open (EvWindow *ev_window, const char *uri) gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", error->message); gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); g_error_free (error); }