aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-calendar-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc/e-calendar-item.c')
-rw-r--r--widgets/misc/e-calendar-item.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index 48febd1f23..9c52e2d9bf 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -2889,18 +2889,26 @@ e_calendar_item_signal_emission_idle_cb (gpointer data)
calitem->signal_emission_idle_id = 0;
+ /* We ref the calitem & check in case it gets destroyed, since we
+ were getting a free memory write here. */
+ gtk_object_ref (calitem);
+
if (calitem->date_range_changed) {
+ calitem->date_range_changed = FALSE;
gtk_signal_emit (GTK_OBJECT (calitem),
e_calendar_item_signals[DATE_RANGE_CHANGED]);
- calitem->date_range_changed = FALSE;
}
- if (calitem->selection_changed) {
+ if (GTK_OBJECT_DESTROYED (calitem)) {
+ g_warning ("e_calendar_item_signal_emission_idle_cb: item destroyed");
+ } else if (calitem->selection_changed) {
+ calitem->selection_changed = FALSE;
gtk_signal_emit (GTK_OBJECT (calitem),
e_calendar_item_signals[SELECTION_CHANGED]);
- calitem->selection_changed = FALSE;
}
+ gtk_object_unref (calitem);
+
GDK_THREADS_LEAVE ();
return FALSE;
}