From: Emmanuele Bassi Date: Wed, 2 Sep 2009 14:26:33 +0000 (+0100) Subject: [model] Do not attempt to free empty column names X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5e081dc9c8f39ce66270b77f5beaa6ac53e7a91;p=profile%2Fivi%2Fclutter.git [model] Do not attempt to free empty column names The column names are optional - ClutterModel will use the GType name if there is no user-specified column name. Hence, the ::finalize vfunc should not try to free an empty column names vector. Fixes bug: http://bugzilla.openedhand.com/show_bug.cgi?id=1790 --- diff --git a/clutter/clutter-model.c b/clutter/clutter-model.c index 3fb9d95..ab04673 100644 --- a/clutter/clutter-model.c +++ b/clutter/clutter-model.c @@ -222,13 +222,16 @@ clutter_model_finalize (GObject *object) g_free (priv->column_types); - /* the column_names vector might have holes in it, so we need to - * use the columns number to clear up everything - */ - for (i = 0; i < priv->n_columns; i++) - g_free (priv->column_names[i]); + if (priv->column_names != NULL) + { + /* the column_names vector might have holes in it, so we need + * to use the columns number to clear up everything + */ + for (i = 0; i < priv->n_columns; i++) + g_free (priv->column_names[i]); - g_free (priv->column_names); + g_free (priv->column_names); + } G_OBJECT_CLASS (clutter_model_parent_class)->finalize (object); }