[evolution-patches] gtkhtml leak fixes



This fixes some small leaks I introduced recently.

--Larry


Index: htmlstyle.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlstyle.c,v
retrieving revision 1.4
diff -u -p -r1.4 htmlstyle.c
--- htmlstyle.c	3 Feb 2003 19:00:51 -0000	1.4
+++ htmlstyle.c	16 Apr 2003 07:02:53 -0000
@@ -79,6 +79,8 @@ html_style_free (HTMLStyle *style)
 
 	if (style->bg_color)
 		gdk_color_free (style->bg_color);
+
+	g_free (style);
 }
 
 HTMLStyle *
Index: gtkhtml-properties.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml-properties.c,v
retrieving revision 1.91
diff -u -p -r1.91 gtkhtml-properties.c
--- gtkhtml-properties.c	9 Apr 2003 18:57:14 -0000	1.91
+++ gtkhtml-properties.c	16 Apr 2003 07:02:53 -0000
@@ -62,19 +62,21 @@ gtk_html_class_properties_new (GtkWidget
 
 	if (!fixed_name) {
 		fixed_name = g_strdup ("Monospace");
-		fixed_desc = pango_font_description_from_string (fixed_name);
 		fixed_size = var_size;
 	}
 
 	/* default values */
-	p->magic_links             = TRUE;
+	/* display */
 	p->animations              = TRUE;
-	p->language                = g_strdup (e_iconv_locale_language ());
+
+	/* editing */
+	p->magic_links             = TRUE;
 	p->live_spell_check        = TRUE;
+	p->language                = g_strdup (e_iconv_locale_language ());
 
-	p->font_var_print          = g_strdup (pango_font_description_get_family (var_desc));
 	/* printf ("Variable Printing Font: \"%s\"\n", p->font_var_print); */
-	p->font_fix_print          = g_strdup (fixed_name);
+	p->font_var_print          = g_strdup (pango_font_description_get_family (var_desc));
+	p->font_fix_print          = fixed_name;
 	p->font_var_size_print     = DEFAULT_FONT_SIZE_PRINT;
 	p->font_fix_size_print     = DEFAULT_FONT_SIZE_PRINT;
 	p->font_var_print_points   = FALSE;
@@ -86,6 +88,9 @@ gtk_html_class_properties_new (GtkWidget
 void
 gtk_html_class_properties_destroy (GtkHTMLClassProperties *p)
 {
+	g_free (p->font_fix_print);
+	g_free (p->font_var_print);
+	g_free (p->language);
 	g_free (p);
 }
 
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.504
diff -u -p -r1.504 gtkhtml.c
--- gtkhtml.c	9 Apr 2003 18:57:14 -0000	1.504
+++ gtkhtml.c	16 Apr 2003 07:02:54 -0000
@@ -761,7 +761,6 @@ style_set (GtkWidget *widget, GtkStyle  
 		
 		if (!fixed_name) {
 			fixed_name = g_strdup ("Monospace");
-			fixed_desc = pango_font_description_from_string (fixed_name);
 			fixed_size = font_var_size;
 		}
 
@@ -776,6 +775,8 @@ style_set (GtkWidget *widget, GtkStyle  
 			html_engine_calc_size (engine, FALSE);
 			html_engine_schedule_update (engine);
 		}
+		
+		g_free (fixed_name);
 	}
 
 
@@ -1000,6 +1001,7 @@ size_allocate (GtkWidget *widget, GtkAll
 		gtk_adjustment_value_changed (GTK_LAYOUT (html)->hadjustment);
 	if (changed_y)
 		gtk_adjustment_value_changed (GTK_LAYOUT (html)->vadjustment);
+
 }
 
 static void
@@ -3655,9 +3657,7 @@ gtk_html_set_default_content_type (GtkHT
 	g_free (html->priv->content_type);	
 
 	if (content_type) {
-		lower = g_strdup (content_type);
-		g_ascii_strdown (lower, strlen (lower));
-		html->priv->content_type = lower;
+		html->priv->content_type = g_ascii_strdown (content_type, -1);
 	} else
 		html->priv->content_type = NULL;
 }
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.1781
diff -u -p -r1.1781 ChangeLog
--- ChangeLog	15 Apr 2003 18:04:07 -0000	1.1781
+++ ChangeLog	16 Apr 2003 07:02:57 -0000
@@ -1,3 +1,14 @@
+2003-04-16  Larry Ewing  <lewing ximian com>
+
+	* htmlstyle.c (html_style_free): actually free the style.
+
+	* gtkhtml-properties.c (gtk_html_class_properties_new): don
+
+	* gtkhtml.c (style_set): free the name string, and don't alloc an
+	uneeded font description.
+	(gtk_html_set_default_content_type): use g_ascii_strdown
+	correctly.
+
 2003-04-15  Larry Ewing  <lewing ximian com>
 
 	* htmldrawqueue.c (clear): clip the cleared area to the visible


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