From 6d0544b0e717d9e0a02cb97ed3bf3ad87863c90c Mon Sep 17 00:00:00 2001 From: Florian DESPORTES Date: Fri, 30 May 2008 12:14:49 -0400 Subject: [PATCH] Prevent from opening two assistants --- sflphone-gtk/src/assistant.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sflphone-gtk/src/assistant.c b/sflphone-gtk/src/assistant.c index a76f97622..6e87bfa4f 100644 --- a/sflphone-gtk/src/assistant.c +++ b/sflphone-gtk/src/assistant.c @@ -41,11 +41,13 @@ set_account_type( GtkWidget* widget , gpointer data ) static void close_callback( void ) { gtk_widget_destroy(wiz->assistant); + g_free(wiz); wiz = NULL; } static void cancel_callback( void ) { gtk_widget_destroy(wiz->assistant); + g_free(wiz); wiz = NULL; } static void @@ -98,6 +100,7 @@ enable_stun( GtkWidget* widget ) void build_wizard( void ) { +if(!wiz){ wiz = ( struct _wizard* )g_malloc( sizeof( struct _wizard)); current = g_new0(account_t, 1); current->properties = g_hash_table_new(NULL, g_str_equal); @@ -116,14 +119,14 @@ build_wizard( void ) build_iax_account_configuration(); build_registration_error(); build_summary(); - + g_signal_connect(G_OBJECT(wiz->assistant), "close" , G_CALLBACK(close_callback), NULL); g_signal_connect(G_OBJECT(wiz->assistant), "cancel" , G_CALLBACK(cancel_callback), NULL); gtk_widget_show_all(wiz->assistant); gtk_assistant_update_buttons_state(GTK_ASSISTANT(wiz->assistant)); - + } } GtkWidget*