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

removed a leak when launchers were destroyed and made config dialog

Mon Aug 10 02:32:19 1998  George Lebl  <jirka@5z.com>

        * launcher.c: removed a leak when launchers were destroyed
          and made config dialog disappear when it's launcher is
          destroyed

        * menu.c: made config dialog disappear when it's menu is
          destroyed

        * drawer.c: made config dialog disappear when it's drawer is
          destroyed

        * panel.c,applet.c: put in hacks to deal with tooltips owning
          a reference count for applets

I've been having a tun of segfaults at very weird places ... can anyone
try this on their own machines and see if they also get segfaults ...
I'll run it though efence tomorrow ...

especially try this .. open up a property box for launcher, drawer or
menu ... and then remove the applet ... I dunno if this will do it ...
but it's the new thing .. and it's been happening when I do that

-George
parent 6c4949d4
Mon Aug 10 02:32:19 1998 George Lebl <jirka@5z.com>
* launcher.c: removed a leak when launchers were destroyed
and made config dialog disappear when it's launcher is
destroyed
* menu.c: made config dialog disappear when it's menu is
destroyed
* drawer.c: made config dialog disappear when it's drawer is
destroyed
* panel.c,applet.c: put in hacks to deal with tooltips owning
a reference count for applets
Sun Aug 09 19:59:18 1998 George Lebl <jirka@5z.com>
* menu.c: implemented properties of menu buttons
......
Mon Aug 10 02:32:19 1998 George Lebl <jirka@5z.com>
* launcher.c: removed a leak when launchers were destroyed
and made config dialog disappear when it's launcher is
destroyed
* menu.c: made config dialog disappear when it's menu is
destroyed
* drawer.c: made config dialog disappear when it's drawer is
destroyed
* panel.c,applet.c: put in hacks to deal with tooltips owning
a reference count for applets
Sun Aug 09 19:59:18 1998 George Lebl <jirka@5z.com>
* menu.c: implemented properties of menu buttons
......
......@@ -29,6 +29,8 @@ extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save;
extern GtkTooltips *panel_tooltips;
static void
move_applet_callback(GtkWidget *widget, gpointer data)
{
......@@ -69,6 +71,13 @@ panel_clean_applet(int applet_id)
panel = gtk_object_get_data(GTK_OBJECT(w),
PANEL_APPLET_PARENT_KEY);
/*warning warning ... HACK ahead*/
/*this makes the refcount right, why a widget that has
a tooltip shouldn't destroy right is beyond me, but
I guess there is a reason .. it just makes things a
lot harder*/
gtk_tooltips_set_tip (panel_tooltips,w,NULL,NULL);
if(panel)
gtk_container_remove(GTK_CONTAINER(panel),w);
}
......
......@@ -239,6 +239,10 @@ static int
destroy_drawer(GtkWidget *widget, gpointer data)
{
Drawer *drawer = data;
GtkWidget *prop_dialog = gtk_object_get_data(GTK_OBJECT(drawer->button),
DRAWER_PROPERTIES);
if(prop_dialog)
gtk_widget_unref(prop_dialog);
g_free(drawer);
return FALSE;
}
......
......@@ -61,6 +61,20 @@ launch (GtkWidget *widget, GdkEvent *event, void *data)
return FALSE;
}
static int
destroy_launcher(GtkWidget *widget, gpointer data)
{
Launcher *launcher = data;
GtkWidget *prop_dialog = gtk_object_get_data(GTK_OBJECT(launcher->button),
LAUNCHER_PROPERTIES);
if(prop_dialog)
gtk_widget_unref(prop_dialog);
gnome_desktop_entry_free(launcher->dentry);
g_free(launcher);
return FALSE;
}
Launcher *
create_launcher (char *parameters, GnomeDesktopEntry *dentry)
{
......@@ -129,6 +143,10 @@ create_launcher (char *parameters, GnomeDesktopEntry *dentry)
"event",
(GtkSignalFunc) launch,
dentry);
gtk_signal_connect (GTK_OBJECT(launcher->button), "destroy",
GTK_SIGNAL_FUNC(destroy_launcher),
launcher);
gtk_object_set_user_data(GTK_OBJECT(launcher->button), launcher);
......
......@@ -1053,6 +1053,10 @@ static void
destroy_menu (GtkWidget *widget, gpointer data)
{
Menu *menu = data;
GtkWidget *prop_dialog = gtk_object_get_data(GTK_OBJECT(menu->button),
MENU_PROPERTIES);
if(prop_dialog)
gtk_widget_unref(prop_dialog);
gtk_widget_unref(menu->menu);
g_free(menu->path);
g_free(menu);
......
......@@ -388,18 +388,17 @@ panel_widget_cremove(GtkContainer *container, GtkWidget *widget)
g_return_if_fail (container != NULL);
g_return_if_fail (IS_PANEL_WIDGET (container));
g_return_if_fail (widget != NULL);
panel = PANEL_WIDGET (container);
ad = gtk_object_get_data(GTK_OBJECT(widget), PANEL_APPLET_DATA);
p = gtk_object_get_data(GTK_OBJECT(widget),
PANEL_APPLET_ASSOC_PANEL_KEY);
gtk_widget_ref(widget);
if (GTK_CONTAINER_CLASS (parent_class)->remove)
(* GTK_CONTAINER_CLASS (parent_class)->remove) (container,
widget);
p = gtk_object_get_data(GTK_OBJECT(widget),
PANEL_APPLET_ASSOC_PANEL_KEY);
if(ad) {
PanelWidget *panel = PANEL_WIDGET (container);
......@@ -414,6 +413,7 @@ panel_widget_cremove(GtkContainer *container, GtkWidget *widget)
gtk_signal_emit(GTK_OBJECT(container),
panel_widget_signals[APPLET_REMOVED_SIGNAL],
widget);
gtk_widget_unref(widget);
}
......@@ -1729,7 +1729,7 @@ panel_widget_add_full (PanelWidget *panel, GtkWidget *applet, int pos, int bind_
g_return_val_if_fail(panel!=NULL,-1);
g_return_val_if_fail(applet!=NULL,-1);
g_return_val_if_fail(pos>=0,-1);
ad = gtk_object_get_data(GTK_OBJECT(applet),PANEL_APPLET_DATA);
if(ad)
......
......@@ -938,6 +938,19 @@ bind_panel_events(GtkWidget *widget, gpointer data)
}
/*warning warning ... HACK ahead*/
static int
panel_widget_destroy(GtkWidget *w, gpointer data)
{
GtkFixed *fixed = GTK_FIXED(w);
GList *list;
for(list = fixed->children; list != NULL; list = g_list_next(list))
/*this makes the refcount right, why a widget that has
a tooltip shouldn't destroy right is beyond me, but
I guess there is a reason .. it just makes things a
lot harder*/
gtk_tooltips_set_tip (panel_tooltips,list->data,NULL,NULL);
}
static void
panel_widget_setup(PanelWidget *panel)
......@@ -958,6 +971,10 @@ panel_widget_setup(PanelWidget *panel)
"back_change",
GTK_SIGNAL_FUNC(panel_back_change),
NULL);
gtk_signal_connect(GTK_OBJECT(panel),
"destroy",
GTK_SIGNAL_FUNC(panel_widget_destroy),
NULL);
}
void
......
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