summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-05-21 22:50:48 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-05-21 22:50:48 -0400
commit898f0fa0b912ea765eae451fb4e07735c03bc365 (patch)
tree83eaf4d894061ac80cdb795eb485dfa142708c9a
parentb90802f7e44f280b9ea233cf71692704e5b52651 (diff)
downloadgtk+-898f0fa0b912ea765eae451fb4e07735c03bc365.tar.gz
Avoid a critical in the file chooser
Hiding the location entry was causing criticals, because the completion was updated after the widget has already been disposed. https://bugzilla.gnome.org/show_bug.cgi?id=720330
-rw-r--r--gtk/gtkfilechooserentry.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 526895bd44..20279e02b0 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -125,18 +125,22 @@ gtk_file_chooser_entry_dispatch_properties_changed (GObject *object,
G_OBJECT_CLASS (_gtk_file_chooser_entry_parent_class)->dispatch_properties_changed (object, n_pspecs, pspecs);
- /* What we are after: The text in front of the cursor was modified.
- * Unfortunately, there's no other way to catch this. */
-
- for (i = 0; i < n_pspecs; i++)
+ /* Don't do this during or after disposal */
+ if (gtk_widget_get_parent (GTK_WIDGET (object)) != NULL)
{
- if (pspecs[i]->name == I_("cursor-position") ||
- pspecs[i]->name == I_("selection-bound") ||
- pspecs[i]->name == I_("text"))
+ /* What we are after: The text in front of the cursor was modified.
+ * Unfortunately, there's no other way to catch this.
+ */
+ for (i = 0; i < n_pspecs; i++)
{
- set_complete_on_load (chooser_entry, FALSE);
- refresh_current_folder_and_file_part (chooser_entry);
- break;
+ if (pspecs[i]->name == I_("cursor-position") ||
+ pspecs[i]->name == I_("selection-bound") ||
+ pspecs[i]->name == I_("text"))
+ {
+ set_complete_on_load (chooser_entry, FALSE);
+ refresh_current_folder_and_file_part (chooser_entry);
+ break;
+ }
}
}
}