window: remove queued event on finalize

When the user removes an event, we first hide it and,
after a timeout, we remove it. The problem is that if
the user closes the window before the timeout is fired,
the event never gets deleted.

Fix that by deleting the event on finalize if there's
any event queued.

https://bugzilla.gnome.org/show_bug.cgi?id=762284
This commit is contained in:
Georges Basile Stavracas Neto
2016-02-18 15:36:56 -02:00
parent d5cd6c7fc9
commit 079750561a
+7
View File
@@ -1390,6 +1390,13 @@ gcal_window_finalize (GObject *object)
window->save_geometry_timeout_id = 0;
}
/* If we have a queued event to delete, remove it now */
if (window->event_to_delete)
{
gcal_manager_remove_event (window->manager, window->event_to_delete);
g_clear_object (&window->event_to_delete);
}
g_clear_object (&window->manager);
g_clear_object (&window->views_switcher);