aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-11-27 06:25:50 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-11-27 06:25:50 +0800
commit2e027278418225def5a643bc811ba909e70d480b (patch)
tree7e05f79745d7631d7864996af2b78da14b6a5589
parentff03e17df722aa29e3cf191446ae6a6f246e8b21 (diff)
downloadgsoc2013-evolution-2e027278418225def5a643bc811ba909e70d480b.tar.gz
gsoc2013-evolution-2e027278418225def5a643bc811ba909e70d480b.tar.zst
gsoc2013-evolution-2e027278418225def5a643bc811ba909e70d480b.zip
(etms_finalize): Call
e_table_memory_store_clear(). svn path=/trunk/; revision=18937
-rw-r--r--widgets/table/e-table-memory-store.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c
index 1d310ddd2f..69765b32ab 100644
--- a/widgets/table/e-table-memory-store.c
+++ b/widgets/table/e-table-memory-store.c
@@ -84,6 +84,7 @@ free_value (ETableMemoryStore *etms, int col, void *value)
}
}
+
static int
etms_column_count (ETableModel *etm)
{
@@ -225,6 +226,8 @@ etms_finalize (GObject *obj)
ETableMemoryStore *etms = (ETableMemoryStore *) obj;
if (etms->priv) {
+ e_table_memory_store_clear (etms);
+
g_free (etms->priv->columns);
g_free (etms->priv->store);
g_free (etms->priv);
@@ -537,7 +540,15 @@ e_table_memory_store_change_adopt (ETableMemoryStore *etms, int row, gpointer da
void
e_table_memory_store_remove (ETableMemoryStore *etms, int row)
{
- int row_count;
+ ETableModel *model;
+ int column_count, row_count;
+ int i;
+
+ model = E_TABLE_MODEL (etms);
+ column_count = e_table_model_column_count (model);
+
+ for (i = 0; i < column_count; i ++)
+ e_table_model_free_value (model, i, e_table_model_value_at (model, i, row));
row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) - 1;
memmove (etms->priv->store + etms->priv->col_count * row,
@@ -551,6 +562,20 @@ e_table_memory_store_remove (ETableMemoryStore *etms, int row)
void
e_table_memory_store_clear (ETableMemoryStore *etms)
{
+ ETableModel *model;
+ int row_count, column_count;
+ int i, j;
+
+ model = E_TABLE_MODEL (etms);
+ row_count = e_table_model_row_count (model);
+ column_count = e_table_model_column_count (model);
+
+ for (i = 0; i < row_count; i ++) {
+ for (j = 0; j < column_count; j ++) {
+ e_table_model_free_value (model, j, e_table_model_value_at (model, j, i));
+ }
+ }
+
e_table_memory_clear (E_TABLE_MEMORY (etms));
g_free (etms->priv->store);