diff options
Diffstat (limited to 'a11y/e-table/gal-a11y-e-cell-tree.c')
-rw-r--r-- | a11y/e-table/gal-a11y-e-cell-tree.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/a11y/e-table/gal-a11y-e-cell-tree.c b/a11y/e-table/gal-a11y-e-cell-tree.c index 068658cafa..b86ecc01bd 100644 --- a/a11y/e-table/gal-a11y-e-cell-tree.c +++ b/a11y/e-table/gal-a11y-e-cell-tree.c @@ -50,9 +50,30 @@ ectr_model_row_changed_cb (ETableModel *etm, } static void +kill_view_cb(ECellView *subcell_view, + GList *subcell_a11ies) +{ + GList *node; + GalA11yECell *subcell; + for (node = subcell_a11ies; node != NULL; node = g_list_next (node)) + { + subcell = GAL_A11Y_E_CELL(node->data); + if (subcell && subcell->cell_view == subcell_view) + { + fprintf(stderr, "subcell_view %p deleted before the a11y object %p\n", subcell_view, subcell); + subcell->cell_view = NULL; + } + } +} + +static void ectr_subcell_weak_ref (GalA11yECellTree *a11y, GalA11yECell *subcell_a11y) { + ECellView *subcell_view = subcell_a11y ? subcell_a11y->cell_view : 0; + if (subcell_a11y && subcell_view && subcell_view->kill_view_cb_data) + g_list_remove(subcell_view->kill_view_cb_data, subcell_a11y); + g_signal_handler_disconnect (GAL_A11Y_E_CELL (a11y)->item->table_model, a11y->model_row_changed_id); g_object_unref (a11y); @@ -207,6 +228,14 @@ gal_a11y_e_cell_tree_new (ETableItem *item, g_signal_connect (item->table_model, "model_row_changed", G_CALLBACK (ectr_model_row_changed_cb), subcell_a11y); + + if (subcell_a11y && subcell_view) + { + subcell_view->kill_view_cb = kill_view_cb; + if (!g_list_find(subcell_view->kill_view_cb_data, subcell_a11y)) + subcell_view->kill_view_cb_data = g_list_append(subcell_view->kill_view_cb_data, subcell_a11y); + } + g_object_weak_ref (G_OBJECT (subcell_a11y), (GWeakNotify) ectr_subcell_weak_ref, a11y); return subcell_a11y; |