[gnumeric] Fix leak. [#664447]



commit 9d640b4ca5fcde4267b02fbf07f15ec6788f5bf3
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Nov 21 08:51:25 2011 -0700

    Fix leak. [#664447]
    
    2011-11-21 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/print.c (gnm_end_print_cb): do not free the printing instance
    	(gnm_print_sheet): but free it here

 ChangeLog   |    5 +++++
 NEWS        |    1 +
 src/print.c |   11 ++++-------
 3 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ea6fce0..441ccde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-11-21 Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* src/print.c (gnm_end_print_cb): do not free the printing instance
+	(gnm_print_sheet): but free it here
+
+2011-11-21 Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* src/print.c (gnm_print_range_get_type): new
 	* src/print.h (gnm_print_range_get_type): new
 	* src/xml-sax-read.c (xml_sax_print_print_range): use
diff --git a/NEWS b/NEWS
index 896c974..8f8be68 100644
--- a/NEWS
+++ b/NEWS
@@ -51,6 +51,7 @@ Andreas:
 	* Add 'object' and 'paper=fit' options to ssconvert pdf export. [#661405]
 	* Add cell view to auto expression. [#455712]
 	* Fix import/export of interpolation methods from/to ODF. [#664351]
+	* Fix leak. [#664447]
 
 Jean:
 	* Make things build against gtk+-3.0.
diff --git a/src/print.c b/src/print.c
index b644b3a..9812a95 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1332,10 +1332,9 @@ gnm_begin_print_cb (GtkPrintOperation *operation,
 static void
 gnm_end_print_cb (G_GNUC_UNUSED GtkPrintOperation *operation,
                   G_GNUC_UNUSED GtkPrintContext   *context,
-                  gpointer           user_data)
+                  G_GNUC_UNUSED gpointer           user_data)
 {
-	PrintingInstance * pi = (PrintingInstance *) user_data;
-	printing_instance_delete (pi);
+	/* PrintingInstance * pi = (PrintingInstance *) user_data; */
 }
 
 static void
@@ -1872,16 +1871,14 @@ gnm_print_sheet (WorkbookControl *wbc, Sheet *sheet,
 			(sheet->print_info, settings);
 		break;
 	case GTK_PRINT_OPERATION_RESULT_CANCEL:
-		/* printing_instance_delete (pi); Done in response to end-print signal */
-		break;
 	case GTK_PRINT_OPERATION_RESULT_ERROR:
-		/* FIXME? */
 		break;
 	case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS:
-		/* FIXME? */
+		/* This can only happen if we were allowing asynchronous operation */
 		break;
 	default: ;
 	}
+	printing_instance_delete (pi);
 
 	if (preview_via_pdf) {
 #ifdef G_OS_WIN32



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]