Commit d7f88e0e authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

fix compilation warning

Fri Mar 01 00:55:39 2002  George Lebl <jirka@5z.com>

	* panel-config-global.c: fix compilation warning

	* panel-widget.c, panel.c: fix some memory leaks and some corruptions
	  on destruction
parent 8b501430
Fri Mar 01 00:55:39 2002 George Lebl <jirka@5z.com>
* panel-config-global.c: fix compilation warning
* panel-widget.c, panel.c: fix some memory leaks and some corruptions
on destruction
2002-02-28 Mark McLoughlin <mark@skynet.ie>
* launcher.c:
......
......@@ -3,6 +3,7 @@
#include <gconf/gconf.h>
#include "panel.h"
#include "panel-util.h"
#undef PANEL_GLOBAL_CONFIG_DEBUG
......
......@@ -66,6 +66,7 @@ static void panel_widget_cremove (GtkContainer *container,
static int panel_widget_expose (GtkWidget *widget,
GdkEventExpose *event);
static void panel_widget_destroy (GtkObject *obj);
static void panel_widget_finalize (GObject *obj);
static void panel_widget_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void panel_widget_realize (GtkWidget *widget);
......@@ -280,6 +281,7 @@ static void
panel_widget_class_init (PanelWidgetClass *class)
{
GtkObjectClass *object_class = (GtkObjectClass*) class;
GObjectClass *gobject_class = (GObjectClass*) class;
GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
GtkContainerClass *container_class = (GtkContainerClass*) class;
......@@ -444,6 +446,7 @@ panel_widget_class_init (PanelWidgetClass *class)
class->end_move = panel_widget_end_move;
object_class->destroy = panel_widget_destroy;
gobject_class->finalize = panel_widget_finalize;
widget_class->size_request = panel_widget_size_request;
widget_class->size_allocate = panel_widget_size_allocate;
......@@ -1605,6 +1608,30 @@ panel_widget_realize(GtkWidget *w)
#endif
}
static void
panel_widget_finalize (GObject *obj)
{
PanelWidget *panel;
GtkWidget *w = GTK_WIDGET (obj);
g_return_if_fail(PANEL_IS_WIDGET(w));
panel = PANEL_WIDGET(w);
g_free (panel->back_pixmap);
panel->back_pixmap = NULL;
/*remove from panels list*/
panels = g_slist_remove(panels,w);
panel_remove_from_gconf (panel);
g_free (panel->unique_id);
panel->unique_id = NULL;
if (G_OBJECT_CLASS (panel_widget_parent_class)->finalize)
G_OBJECT_CLASS (panel_widget_parent_class)->finalize (obj);
}
static void
panel_widget_destroy (GtkObject *obj)
{
......
......@@ -625,7 +625,7 @@ panel_destroy (GtkWidget *widget, gpointer data)
}
if (pd->menu != NULL)
gtk_widget_unref (pd->menu);
g_object_unref (G_OBJECT (pd->menu));
pd->menu = NULL;
pd->panel = NULL;
......@@ -2647,10 +2647,11 @@ panel_remove_from_gconf (PanelWidget *panel)
PANEL_WIDGET (panel)->unique_id);
panel_gconf_clean_dir (panel_gconf_get_client (), dir);
g_free (key);
} else
g_free (dir);
g_free (l->data);
} else {
new_panels = g_slist_prepend (new_panels, l->data);
}
}
g_slist_free (panels);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment