summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mixgtk/mixgtk_gen_handlers.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mixgtk/mixgtk_gen_handlers.c b/mixgtk/mixgtk_gen_handlers.c
index f52969d..983c16c 100644
--- a/mixgtk/mixgtk_gen_handlers.c
+++ b/mixgtk/mixgtk_gen_handlers.c
@@ -33,9 +33,11 @@ static file_callback_t callback_ = NULL;
static void
on_file_ok_ (GtkWidget *w, gpointer fs)
{
- const gchar *file = gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs));
- if (callback_) callback_ (file);
+ gchar *file = g_strdup
+ (gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
gtk_widget_destroy (GTK_WIDGET (fs));
+ if (callback_) callback_ (file);
+ g_free (file);
}
static void