diff options
author | Damon Chaplin <damon@ximian.com> | 2001-10-30 09:37:52 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-10-30 09:37:52 +0800 |
commit | cf4dbf9ee3790b9cf5e146594fa851757cd89881 (patch) | |
tree | a7b5fc1a3a17c61e7f3e49e3cdf218c5cb8f9819 /widgets/misc/e-calendar-item.c | |
parent | 46dee516710185ab5fb881a02580c66f3e82181c (diff) | |
download | gsoc2013-evolution-cf4dbf9ee3790b9cf5e146594fa851757cd89881.tar.gz gsoc2013-evolution-cf4dbf9ee3790b9cf5e146594fa851757cd89881.tar.zst gsoc2013-evolution-cf4dbf9ee3790b9cf5e146594fa851757cd89881.zip |
ref the ECalendarItem and check if it gets destroyed, to try to avoid a
2001-10-29 Damon Chaplin <damon@ximian.com>
* e-calendar-item.c (e_calendar_item_signal_emission_idle_cb): ref
the ECalendarItem and check if it gets destroyed, to try to avoid a
free memory write.
* e-dateedit.c (e_date_edit_set_time_of_day): allow setting the time
to empty by passing hour as -1.
svn path=/trunk/; revision=14394
Diffstat (limited to 'widgets/misc/e-calendar-item.c')
-rw-r--r-- | widgets/misc/e-calendar-item.c | 14 |
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; } |