From b6df8cde7b24dd3548afd4a988894d8fae1942c5 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Mon, 30 Apr 2018 21:26:03 -0300 Subject: [PATCH] manager: fix reference management GcalManager:remove_event() is an asynchronous function that, by the time the callback is executed, unreferences the event that is being removed. This implies that, when the function was called, a reference was taken -- we don't want the event to be finalized during the operation, after all. The problem is that the reference was never taken. Fix that by properly owning a reference to the event when removing it, and dropping it when the removal is finished. Issue: #268 --- src/gcal-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gcal-manager.c b/src/gcal-manager.c index 385d7e09..d36b07da 100644 --- a/src/gcal-manager.c +++ b/src/gcal-manager.c @@ -1715,7 +1715,7 @@ gcal_manager_remove_event (GcalManager *self, (ECalObjModType) mod, self->async_ops, on_event_removed, - event); + g_object_ref (event)); g_free (rid);