Gtk+ leaks
- From: Alexander Larsson <alla lysator liu se>
- To: gtk-devel-list gnome org
- Subject: Gtk+ leaks
- Date: Tue, 23 Jan 2001 12:35:19 +0100 (CET)
More leaks...
Can I check in?
Index: gtk/gtkimage.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkimage.c,v
retrieving revision 1.15
diff -u -p -r1.15 gtkimage.c
--- gtk/gtkimage.c 2000/11/01 16:24:21 1.15
+++ gtk/gtkimage.c 2001/01/23 11:30:34
@@ -34,6 +34,8 @@ static gint gtk_image_expose (GtkW
GdkEventExpose *event);
static void gtk_image_size_request (GtkWidget *widget,
GtkRequisition *requisition);
+static void gtk_image_finalize (GObject *object);
+static void gtk_image_free (GtkImage *image);
static void gtk_image_clear (GtkImage *image);
static void gtk_image_update_size (GtkImage *image,
gint image_width,
@@ -69,10 +71,15 @@ gtk_image_get_type (void)
static void
gtk_image_class_init (GtkImageClass *class)
{
+ GObjectClass *gobject_class;
GtkWidgetClass *widget_class;
parent_class = g_type_class_peek_parent (class);
+
+ gobject_class = G_OBJECT_CLASS (class);
+ gobject_class->finalize = gtk_image_finalize;
+
widget_class = (GtkWidgetClass*) class;
widget_class->expose_event = gtk_image_expose;
@@ -87,6 +94,21 @@ gtk_image_init (GtkImage *image)
image->storage_type = GTK_IMAGE_EMPTY;
}
+static void
+gtk_image_finalize (GObject *object)
+{
+ GtkImage *image;
+
+ g_return_if_fail (GTK_IS_IMAGE (object));
+
+ image = GTK_IMAGE (object);
+
+ gtk_image_free (image);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+
GtkWidget*
gtk_image_new_from_pixmap (GdkPixmap *pixmap,
GdkBitmap *mask)
@@ -630,7 +652,7 @@ gtk_image_expose (GtkWidget *widget
}
static void
-gtk_image_clear (GtkImage *image)
+gtk_image_free (GtkImage *image)
{
switch (image->storage_type)
{
@@ -697,7 +719,13 @@ gtk_image_clear (GtkImage *image)
}
image->storage_type = GTK_IMAGE_EMPTY;
+}
+static void
+gtk_image_clear (GtkImage *image)
+{
+ gtk_image_free (image);
+
GTK_WIDGET (image)->requisition.width = 0;
GTK_WIDGET (image)->requisition.height = 0;
Index: gtk/gtklabel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklabel.c,v
retrieving revision 1.67
diff -u -p -r1.67 gtklabel.c
--- gtk/gtklabel.c 2001/01/17 21:32:34 1.67
+++ gtk/gtklabel.c 2001/01/23 11:30:35
@@ -276,7 +276,7 @@ set_markup (GtkLabel *label,
}
if (text)
- gtk_label_set_text (label, text);
+ gtk_label_set_text_internal (label, text);
if (attrs)
{
Index: gtk/gtktextlayout.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextlayout.c,v
retrieving revision 1.52
diff -u -p -r1.52 gtktextlayout.c
--- gtk/gtktextlayout.c 2001/01/23 06:09:49 1.52
+++ gtk/gtktextlayout.c 2001/01/23 11:30:37
@@ -1903,8 +1903,8 @@ gtk_text_layout_free_line_display (GtkTe
{
g_slist_foreach (display->cursors, (GFunc)g_free, NULL);
g_slist_free (display->cursors);
- g_slist_free (display->shaped_objects);
}
+ g_slist_free (display->shaped_objects);
g_free (display);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]