diff options
author | Bastien Nocera <hadess@hadess.net> | 2005-12-18 14:06:32 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2005-12-18 14:06:32 +0000 |
commit | b2a68d9d4463a501457f5bb0f5ebf4946df324fe (patch) | |
tree | b6507472beee0e63d32ae1cbd856031645b76f38 | |
parent | bdedb16b5e3191a26be483df3238f79a7484c4d4 (diff) | |
download | totem-b2a68d9d4463a501457f5bb0f5ebf4946df324fe.tar.gz |
Fix crash when calling the "add to playlist dialogue twice" (Closes:
2005-12-18 Bastien Nocera <hadess@hadess.net>
* src/totem-uri.c: (totem_setup_file_filters),
(totem_destroy_file_filters), (totem_add_files):
* src/totem-uri.h:
* src/totem.c: (totem_action_exit): Fix crash when calling the "add
to playlist dialogue twice" (Closes: #324240)
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/totem-uri.c | 13 | ||||
-rw-r--r-- | src/totem-uri.h | 1 | ||||
-rw-r--r-- | src/totem.c | 1 |
4 files changed, 22 insertions, 1 deletions
@@ -1,5 +1,13 @@ 2005-12-18 Bastien Nocera <hadess@hadess.net> + * src/totem-uri.c: (totem_setup_file_filters), + (totem_destroy_file_filters), (totem_add_files): + * src/totem-uri.h: + * src/totem.c: (totem_action_exit): Fix crash when calling the "add + to playlist dialogue twice" (Closes: #324240) + +2005-12-18 Bastien Nocera <hadess@hadess.net> + * src/totem-private.h: * src/totem-sidebar.c: (cb_resize), (cb_got_size), (on_sidebar_button_toggled): patch from Ronald Bultje diff --git a/src/totem-uri.c b/src/totem-uri.c index 5f04fe974..81160f614 100644 --- a/src/totem-uri.c +++ b/src/totem-uri.c @@ -222,6 +222,7 @@ totem_setup_file_filters (void) filter_all = gtk_file_filter_new (); gtk_file_filter_set_name (filter_all, _("All files")); gtk_file_filter_add_pattern (filter_all, "*"); + g_object_ref (filter_all); filter_supported = gtk_file_filter_new (); gtk_file_filter_set_name (filter_supported, @@ -229,6 +230,14 @@ totem_setup_file_filters (void) for (i = 0; i < G_N_ELEMENTS (mime_types); i++) { gtk_file_filter_add_mime_type (filter_supported, mime_types[i]); } + g_object_ref (filter_supported); +} + +void +totem_destroy_file_filters (void) +{ + g_object_unref (filter_all); + g_object_unref (filter_supported); } GSList * @@ -262,8 +271,10 @@ totem_add_files (GtkWindow *parent, const char *path, char **new_path) while (gtk_events_pending()) gtk_main_iteration(); - if (response != GTK_RESPONSE_ACCEPT) + if (response != GTK_RESPONSE_ACCEPT) { + gtk_widget_destroy (fs); return NULL; + } filenames = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (fs)); if (filenames == NULL) { diff --git a/src/totem-uri.h b/src/totem-uri.h index 4de2f6d43..9275fdec2 100644 --- a/src/totem-uri.h +++ b/src/totem-uri.h @@ -34,6 +34,7 @@ gboolean totem_playing_dvd (const char *uri); gboolean totem_is_block_device (const char *uri); void totem_setup_file_monitoring (Totem *totem); void totem_setup_file_filters (void); +void totem_destroy_file_filters (void); char* totem_uri_get_subtitle_uri (const char *uri); char* totem_uri_escape_for_display (const char *uri); GSList* totem_add_files (GtkWindow *parent, diff --git a/src/totem.c b/src/totem.c index 21d6b2a48..ac3f7ee60 100644 --- a/src/totem.c +++ b/src/totem.c @@ -194,6 +194,7 @@ totem_action_exit (Totem *totem) totem_action_fullscreen (totem, FALSE); totem_sublang_exit (totem); + totem_destroy_file_filters (); totem_named_icons_dispose (totem); if (totem->bvw) |