grim/gplate

Parents 6bf8035ff21e
Children 809a0bef00d1
Fix a crash bug which is more like i forgot to migrate code when i migrated a function :)
--- a/gplate/variables/gplate-object-variable.c Fri Jan 02 07:53:56 2009 -0600
+++ b/gplate/variables/gplate-object-variable.c Fri Jan 02 08:20:14 2009 -0600
@@ -78,9 +78,13 @@
static GPlateVariable *
gplate_variable_from_paramspec(GObject *obj, GParamSpec *pspec) {
GPlateVariable *variable = NULL;
- GValue value;
- const gchar *name = g_param_spec_get_name(pspec);
+ GValue value = { 0, };
+ const gchar *name = NULL;
+
+ /* initialize our value to the type of the pspec */
+ g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE(pspec));
+ name = g_param_spec_get_name(pspec);
g_object_get_property(obj, name, &value);
switch(G_PARAM_SPEC_VALUE_TYPE(pspec)) {