r18038 - gnucash/branches/webkit/src - 1) Fix crash when closing reports - the widget hierarchy wasn't being handled properly

Phil Longstaff plongstaff at code.gnucash.org
Fri Apr 10 18:29:48 EDT 2009


Author: plongstaff
Date: 2009-04-10 18:29:48 -0400 (Fri, 10 Apr 2009)
New Revision: 18038
Trac: http://svn.gnucash.org/trac/changeset/18038

Modified:
   gnucash/branches/webkit/src/html/gnc-html-graph-gog-webkit.c
   gnucash/branches/webkit/src/html/gnc-html-webkit.c
   gnucash/branches/webkit/src/html/gnc-html.c
   gnucash/branches/webkit/src/html/gncmod-html.c
   gnucash/branches/webkit/src/report/report-gnome/gnc-plugin-page-report.c
   gnucash/branches/webkit/src/report/report-system/gnc-report.c
Log:
1) Fix crash when closing reports - the widget hierarchy wasn't being handled properly
2) Fix some memory leaks in reports



Modified: gnucash/branches/webkit/src/html/gnc-html-graph-gog-webkit.c
===================================================================
--- gnucash/branches/webkit/src/html/gnc-html-graph-gog-webkit.c	2009-04-10 20:20:11 UTC (rev 18037)
+++ gnucash/branches/webkit/src/html/gnc-html-graph-gog-webkit.c	2009-04-10 22:29:48 UTC (rev 18038)
@@ -230,6 +230,7 @@
 	}
 
 	base64_buf = g_base64_encode( pixel_buffer, pixel_buffer_size );
+	g_free( pixel_buffer );
 	return base64_buf;
 }
 

Modified: gnucash/branches/webkit/src/html/gnc-html-webkit.c
===================================================================
--- gnucash/branches/webkit/src/html/gnc-html-webkit.c	2009-04-10 20:20:11 UTC (rev 18037)
+++ gnucash/branches/webkit/src/html/gnc-html-webkit.c	2009-04-10 22:29:48 UTC (rev 18038)
@@ -190,6 +190,8 @@
 	GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
 
 	if( priv->web_view != NULL ) {
+		gtk_container_remove( GTK_CONTAINER(priv->base.container),
+						GTK_WIDGET(priv->web_view) );
 		g_object_unref( G_OBJECT(priv->web_view) );
 		priv->web_view = NULL;
 	}

Modified: gnucash/branches/webkit/src/html/gnc-html.c
===================================================================
--- gnucash/branches/webkit/src/html/gnc-html.c	2009-04-10 20:20:11 UTC (rev 18037)
+++ gnucash/branches/webkit/src/html/gnc-html.c	2009-04-10 22:29:48 UTC (rev 18038)
@@ -122,6 +122,7 @@
 	GncHtmlPrivate* priv = GNC_HTML_GET_PRIVATE(self);
 
 	if( priv->container != NULL ) {
+		gtk_widget_destroy( GTK_WIDGET(priv->container) );
 		g_object_unref( G_OBJECT(priv->container) );
 		priv->container = NULL;
 	}
@@ -531,7 +532,7 @@
 }
 
 void
-gnc_html_initialize (void)
+gnc_html_initialize( void )
 {
   int i;
   static struct {

Modified: gnucash/branches/webkit/src/html/gncmod-html.c
===================================================================
--- gnucash/branches/webkit/src/html/gncmod-html.c	2009-04-10 20:20:11 UTC (rev 18037)
+++ gnucash/branches/webkit/src/html/gncmod-html.c	2009-04-10 22:29:48 UTC (rev 18038)
@@ -68,6 +68,7 @@
 	}
 
 	scm_init_sw_gnc_html_module();
+	gnc_html_initialize();
 	lmod( "(sw_gnc_html)" );
 //	lmod( "(gnucash gnc_html)" );
 

Modified: gnucash/branches/webkit/src/report/report-gnome/gnc-plugin-page-report.c
===================================================================
--- gnucash/branches/webkit/src/report/report-gnome/gnc-plugin-page-report.c	2009-04-10 20:20:11 UTC (rev 18037)
+++ gnucash/branches/webkit/src/report/report-gnome/gnc-plugin-page-report.c	2009-04-10 22:29:48 UTC (rev 18038)
@@ -362,6 +362,7 @@
 
         gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
         gnc_html_show_url(priv->html, type, url_location, url_label, 0);
+		g_free(url_location);
         gnc_window_set_progressbar_window( NULL );
 
         g_signal_connect(priv->container, "expose_event",

Modified: gnucash/branches/webkit/src/report/report-system/gnc-report.c
===================================================================
--- gnucash/branches/webkit/src/report/report-system/gnc-report.c	2009-04-10 20:20:11 UTC (rev 18037)
+++ gnucash/branches/webkit/src/report/report-system/gnc-report.c	2009-04-10 22:29:48 UTC (rev 18038)
@@ -144,6 +144,7 @@
 
   str = g_strdup_printf("(gnc:report-run %d)", report_id);
   scm_text = gfec_eval_string(str, error_handler);
+  g_free(str);
 
   if (scm_text == SCM_UNDEFINED || !SCM_STRINGP (scm_text))
     return FALSE;



More information about the gnucash-changes mailing list