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
This commit is contained in:
Georges Basile Stavracas Neto
2018-04-30 21:26:03 -03:00
parent bc0744cc0d
commit b6df8cde7b
+1 -1
View File
@@ -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);