diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-11-10 19:43:41 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-11-11 13:15:24 +0200 |
commit | e2fbb74301adc2ccaaf9e4e7a8c658322aa6dba2 (patch) | |
tree | a60e43cb2464b6dc4fd861dec66100aa6212903b /gio | |
parent | 705a59a315dcc8cdbc0d14e41d6ffd906fb3f1c7 (diff) | |
download | glib-e2fbb74301adc2ccaaf9e4e7a8c658322aa6dba2.tar.gz |
Assert that GFileIcon::file is always set after construction
Diffstat (limited to 'gio')
-rw-r--r-- | gio/gfileicon.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gio/gfileicon.c b/gio/gfileicon.c index c77622933..5e6e65250 100644 --- a/gio/gfileicon.c +++ b/gio/gfileicon.c @@ -112,6 +112,19 @@ g_file_icon_set_property (GObject *object, } static void +g_file_icon_constructed (GObject *object) +{ + GFileIcon *icon; + + G_OBJECT_CLASS (g_file_icon_parent_class)->constructed (object); + + icon = G_FILE_ICON (object); + + /* Must have be set during construction */ + g_assert (icon->file != NULL); +} + +static void g_file_icon_finalize (GObject *object) { GFileIcon *icon; @@ -132,6 +145,7 @@ g_file_icon_class_init (GFileIconClass *klass) gobject_class->get_property = g_file_icon_get_property; gobject_class->set_property = g_file_icon_set_property; gobject_class->finalize = g_file_icon_finalize; + gobject_class->constructed = g_file_icon_constructed; /** * GFileIcon:file: |