diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/e-canvas.c | 6 | ||||
-rw-r--r-- | widgets/table/e-table-item.c | 34 |
2 files changed, 29 insertions, 11 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 8126367145..0b9c00261a 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -134,6 +134,7 @@ e_canvas_destroy (GtkObject *object) if (canvas->idle_id) g_source_remove(canvas->idle_id); + canvas->idle_id = 0; if (canvas->toplevel) { if (canvas->visibility_notify_id) @@ -736,6 +737,11 @@ static void e_canvas_unrealize (GtkWidget *widget) { ECanvas * ecanvas = E_CANVAS (widget); + + if (ecanvas->idle_id) + g_source_remove(ecanvas->idle_id); + ecanvas->idle_id = 0; + if (ecanvas->ic) { gdk_ic_destroy (ecanvas->ic); ecanvas->ic = NULL; diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index c324d3a90c..0d947a942f 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -610,19 +610,21 @@ height_cache_idle(ETableItem *eti) static void free_height_cache (ETableItem *eti) { - if (eti->height_cache) - g_free (eti->height_cache); - eti->height_cache = NULL; - eti->height_cache_idle_count = 0; - eti->uniform_row_height_cache = -1; + if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS (eti)) { + if (eti->height_cache) + g_free (eti->height_cache); + eti->height_cache = NULL; + eti->height_cache_idle_count = 0; + eti->uniform_row_height_cache = -1; + + if (eti->uniform_row_height && eti->height_cache_idle_id != 0) { + g_source_remove(eti->height_cache_idle_id); + eti->height_cache_idle_id = 0; + } - if (eti->uniform_row_height && eti->height_cache_idle_id != 0) { - g_source_remove(eti->height_cache_idle_id); - eti->height_cache_idle_id = 0; + if ((!eti->uniform_row_height) && eti->height_cache_idle_id == 0) + eti->height_cache_idle_id = g_idle_add_full(G_PRIORITY_LOW, (GSourceFunc) height_cache_idle, eti, NULL); } - - if ((!eti->uniform_row_height) && eti->height_cache_idle_id == 0) - eti->height_cache_idle_id = g_idle_add_full(G_PRIORITY_LOW, (GSourceFunc) height_cache_idle, eti, NULL); } static void @@ -1639,6 +1641,16 @@ eti_unrealize (GnomeCanvasItem *item) if (eti_editing (eti)) e_table_item_leave_edit_(eti); + if (eti->height_cache_idle_id) { + g_source_remove(eti->height_cache_idle_id); + eti->height_cache_idle_id = 0; + } + + if (eti->height_cache) + g_free (eti->height_cache); + eti->height_cache = NULL; + eti->height_cache_idle_count = 0; + gdk_gc_unref (eti->fill_gc); eti->fill_gc = NULL; gdk_gc_unref (eti->grid_gc); |