diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-03-17 19:56:33 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-03-17 19:59:55 -0400 |
commit | 3ec954a54aaf584ccb433f552abfa1ffe1f060c1 (patch) | |
tree | fd7d8c7ed216feaba7e701854d19fc6643fc8ece /gtk/gtkfilechoosernativeportal.c | |
parent | e5ae946be36589e7b946f3a87f8e41127caa872e (diff) | |
download | gtk+-3ec954a54aaf584ccb433f552abfa1ffe1f060c1.tar.gz |
Avoid a critical warning in the filechooser portal
This was showing up when cancelling a portal file chooser
in recipes.
Diffstat (limited to 'gtk/gtkfilechoosernativeportal.c')
-rw-r--r-- | gtk/gtkfilechoosernativeportal.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c index 981e0d5471..45ceb3f4cf 100644 --- a/gtk/gtkfilechoosernativeportal.c +++ b/gtk/gtkfilechoosernativeportal.c @@ -110,15 +110,17 @@ response_cb (GDBusConnection *connection, choices = g_variant_lookup_value (response_data, "choices", G_VARIANT_TYPE ("a(ss)")); if (choices) - for (i = 0; i < g_variant_n_children (choices); i++) - { - const char *id; - const char *selected; - g_variant_get_child (choices, i, "(&s&s)", &id, &selected); - gtk_file_chooser_set_choice (GTK_FILE_CHOOSER (self), id, selected); - } - - g_variant_unref (choices); + { + for (i = 0; i < g_variant_n_children (choices); i++) + { + const char *id; + const char *selected; + g_variant_get_child (choices, i, "(&s&s)", &id, &selected); + gtk_file_chooser_set_choice (GTK_FILE_CHOOSER (self), id, selected); + } + g_variant_unref (choices); + } + g_slist_free_full (self->custom_files, g_object_unref); self->custom_files = NULL; for (i = 0; uris[i]; i++) |