diff options
-rw-r--r-- | widgets/table/e-table-one.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/widgets/table/e-table-one.c b/widgets/table/e-table-one.c index 24ea978f19..123b45712d 100644 --- a/widgets/table/e-table-one.c +++ b/widgets/table/e-table-one.c @@ -136,26 +136,30 @@ one_finalize (GObject *object) { ETableOne *one = E_TABLE_ONE (object); + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +one_dispose (GObject *object) +{ + ETableOne *one = E_TABLE_ONE (object); + + if (one->data) { int i; int col_count; - col_count = e_table_model_column_count(one->source); + if (one->source) { + col_count = e_table_model_column_count(one->source); - for (i = 0; i < col_count; i++) - e_table_model_free_value(one->source, i, one->data[i]); + for (i = 0; i < col_count; i++) + e_table_model_free_value(one->source, i, one->data[i]); + } + g_free (one->data); } one->data = NULL; - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -static void -one_dispose (GObject *object) -{ - ETableOne *one = E_TABLE_ONE (object); - if (one->source) g_object_unref(one->source); one->source = NULL; |