diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-08-17 15:23:43 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-08-17 15:23:43 +0800 |
commit | 31bb4b3f7b78a5de511b4339cce3838bf155f554 (patch) | |
tree | 5ecc43072950809a4fb344e2fae4df1850dcd2ad /widgets/table | |
parent | 2a35d74f460585437d3cddcbf0708b2a41a6219b (diff) | |
download | gsoc2013-evolution-31bb4b3f7b78a5de511b4339cce3838bf155f554.tar.gz gsoc2013-evolution-31bb4b3f7b78a5de511b4339cce3838bf155f554.tar.zst gsoc2013-evolution-31bb4b3f7b78a5de511b4339cce3838bf155f554.zip |
Destroy the hash table and all objects in it, as well as the priv
2001-08-17 Christopher James Lahey <clahey@ximian.com>
* e-table-without.c (etw_destroy): Destroy the hash table and all
objects in it, as well as the priv structure.
svn path=/trunk/; revision=12147
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-table-without.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index 4769d53647..148ee5506b 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -92,6 +92,32 @@ remove_row (ETableWithout *etw, int view_row) } static void +delete_hash_element (gpointer key, + gpointer value, + gpointer closure) +{ + ETableWithout *etw = closure; + etw->priv->free_duplicated_key_func (key, etw->priv->closure); +} + +static void +etw_destroy (GtkObject *object) +{ + ETableWithout *etw = E_TABLE_WITHOUT (object); + + if (etw->priv) { + if (etw->priv->hash) { + g_hash_table_foreach (etw->priv->hash, delete_hash_element, etw); + g_hash_table_destroy (etw->priv->hash); + etw->priv->hash = NULL; + } + g_free (etw->priv); + etw->priv = NULL; + } + +} + +static void etw_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *etm, int model_row, int count) { int i; @@ -152,8 +178,12 @@ etw_proxy_model_changed (ETableSubset *etss, ETableModel *etm) static void etw_class_init (ETableWithoutClass *klass) { - ETableSubsetClass *etss_class = E_TABLE_SUBSET_CLASS (klass); - parent_class = gtk_type_class (PARENT_TYPE); + ETableSubsetClass *etss_class = E_TABLE_SUBSET_CLASS (klass); + GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); + + parent_class = gtk_type_class (PARENT_TYPE); + + object_class->destroy = etw_destroy; etss_class->proxy_model_rows_inserted = etw_proxy_model_rows_inserted; etss_class->proxy_model_rows_deleted = etw_proxy_model_rows_deleted; |