[gtk+/gtk-3-22] FileChooserButton: Avoid unref()ing a null model
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] FileChooserButton: Avoid unref()ing a null model
- Date: Fri, 6 Oct 2017 23:47:33 +0000 (UTC)
commit b45aa63b756abbbcf2f493e72b980437ef84dd2f
Author: Daniel Boles <dboles src gnome org>
Date: Fri Oct 6 21:34:03 2017 +0100
FileChooserButton: Avoid unref()ing a null model
Otherwise simply closing the widget-factory would give a critical from
g_object_unref().
gtk/gtkfilechooserbutton.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index 957cf23..e5c0225 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -994,7 +994,8 @@ gtk_file_chooser_button_finalize (GObject *object)
if (priv->current_folder_while_inactive)
g_object_unref (priv->current_folder_while_inactive);
- g_object_unref (priv->model);
+ if (priv->model != NULL)
+ g_object_unref (priv->model);
G_OBJECT_CLASS (gtk_file_chooser_button_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]