From 231de7054a8f92990bc3b9da7dbddfa18cc44ff1 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 2 Sep 2008 02:02:20 +0200 Subject: netdomjoin-gui: fix some widget closing callbacks. Guenther (This used to be commit 8d541a3579637bb48c04ebb2b18844509c1f43e8) --- .../netapi/examples/netdomjoin-gui/netdomjoin-gui.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'source3/lib/netapi/examples/netdomjoin-gui') diff --git a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c index bf41ee430d..98994b69f8 100644 --- a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c +++ b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c @@ -104,14 +104,23 @@ static gboolean callback_delete_event(GtkWidget *widget, return FALSE; } -static void callback_do_close(GtkWidget *widget, - gpointer data) +static void callback_do_close_data(GtkWidget *widget, + gpointer data) { - debug("callback_do_close called\n"); + debug("callback_do_close_data called\n"); if (data) { gtk_widget_destroy(GTK_WIDGET(data)); - data = NULL; + } +} + +static void callback_do_close_widget(GtkWidget *widget, + gpointer data) +{ + debug("callback_do_close_widget called\n"); + + if (widget) { + gtk_widget_destroy(widget); } } @@ -503,7 +512,7 @@ static void callback_creds_prompt(GtkWidget *widget, gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS); g_signal_connect(G_OBJECT(window), "delete_event", - G_CALLBACK(callback_do_close), window); + G_CALLBACK(callback_do_close_widget), NULL); state->window_creds_prompt = window; gtk_container_set_border_width(GTK_CONTAINER(window), 10); @@ -1106,7 +1115,7 @@ static void callback_do_change(GtkWidget *widget, gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS); g_signal_connect(G_OBJECT(window), "delete_event", - G_CALLBACK(callback_do_close), window); + G_CALLBACK(callback_do_close_widget), NULL); gtk_container_set_border_width(GTK_CONTAINER(window), 10); -- cgit