aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog14
-rw-r--r--calendar/gui/e-day-view.c10
-rw-r--r--calendar/gui/e-week-view.c9
3 files changed, 32 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index a8953c347b..2d8ac3e8b0 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,4 +1,16 @@
-2004-04-21 JP Rosevear <jpr@ximian.com>
+2004-04-22 JP Rosevear <jpr@ximian.com>
+
+ Fixes #56092
+
+ * gui/e-day-view.c (e_day_view_show_popup_menu): weak ref for the
+ menu to be destroyed
+ (popup_destroyed_cb): reset popup_event_num and popup_event_day
+
+ * gui/e-week-view.c (e_week_view_show_popup_menu): weak ref for
+ the menu to be destroyed
+ (popup_destroyed_cb): reset the popup_event_num
+
+2004-04-21 JP Rosevear <jpr@ximian.com>
* gui/calendar-component.c (create_new_event): make sure we don't
deref a NULL pointer
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 4aa223228c..b3f65de4b3 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -3269,6 +3269,15 @@ e_day_view_on_event_double_click (EDayView *day_view,
}
static void
+popup_destroyed_cb (gpointer data, GObject *where_object_was)
+{
+ EDayView *day_view = data;
+
+ day_view->popup_event_day = -1;
+ day_view->popup_event_num = -1;
+}
+
+static void
e_day_view_show_popup_menu (EDayView *day_view,
GdkEvent *gdk_event,
gint day,
@@ -3280,6 +3289,7 @@ e_day_view_show_popup_menu (EDayView *day_view,
day_view->popup_event_num = event_num;
popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (day_view));
+ g_object_weak_ref (G_OBJECT (popup), popup_destroyed_cb, day_view);
e_popup_menu (popup, gdk_event);
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 5feb39bfbb..00dc957248 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -3703,6 +3703,14 @@ e_week_view_key_press (GtkWidget *widget, GdkEventKey *event)
return handled;
}
+static void
+popup_destroyed_cb (gpointer data, GObject *where_object_was)
+{
+ EWeekView *week_view = data;
+
+ week_view->popup_event_num = -1;
+}
+
void
e_week_view_show_popup_menu (EWeekView *week_view,
GdkEventButton *bevent,
@@ -3713,6 +3721,7 @@ e_week_view_show_popup_menu (EWeekView *week_view,
week_view->popup_event_num = event_num;
popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (week_view));
+ g_object_weak_ref (G_OBJECT (popup), popup_destroyed_cb, week_view);
e_popup_menu (popup, (GdkEvent *) bevent);
}