diff --git a/source/libublsettingsui-gtk3-filechooser.c b/source/libublsettingsui-gtk3-filechooser.c index 7e41b5f..44c8447 100644 --- a/source/libublsettingsui-gtk3-filechooser.c +++ b/source/libublsettingsui-gtk3-filechooser.c @@ -70,6 +70,10 @@ void yon_file_chooser_set_button_label(char *label){ } +void on_file_chooser_exit(GtkWidget *, filechooser_window *){ + __yon_filechooser_window = NULL; +} + filechooser_window *yon_file_chooser_window_new(GtkFileChooserAction action){ if (!__yon_filechooser_window){ filechooser_window *window = malloc(sizeof(filechooser_window)); @@ -87,6 +91,7 @@ filechooser_window *yon_file_chooser_window_new(GtkFileChooserAction action){ g_signal_connect(G_OBJECT(window->MainFileChooser),"selection-changed",G_CALLBACK(on_file_chooser_selected),window); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_file_chooser_cancel),window); g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_file_chooser_accept),window); + g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(on_file_chooser_exit),window); gtk_file_chooser_set_action(GTK_FILE_CHOOSER(window->MainFileChooser),action); switch(action){