mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-12 19:41:18 +00:00
mm-provider: Cancel ongoing operations
both when MM has appeared on DBus and when disposing of the provider.
This commit is contained in:
parent
48a77cda5c
commit
ad14d8ba82
1 changed files with 10 additions and 1 deletions
|
@ -50,6 +50,8 @@ struct _CallsMMProvider {
|
|||
MMManager *mm;
|
||||
/* A list of CallsOrigins */
|
||||
GListStore *origins;
|
||||
|
||||
GCancellable *cancellable;
|
||||
};
|
||||
|
||||
static void calls_mm_provider_message_source_interface_init (CallsMessageSourceInterface *iface);
|
||||
|
@ -310,9 +312,13 @@ mm_appeared_cb (GDBusConnection *connection,
|
|||
{
|
||||
g_debug ("ModemManager appeared on D-Bus");
|
||||
|
||||
g_cancellable_cancel (self->cancellable);
|
||||
g_clear_object (&self->cancellable);
|
||||
self->cancellable = g_cancellable_new ();
|
||||
|
||||
mm_manager_new (connection,
|
||||
G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
|
||||
NULL,
|
||||
self->cancellable,
|
||||
(GAsyncReadyCallback) mm_manager_new_cb,
|
||||
self);
|
||||
}
|
||||
|
@ -390,6 +396,9 @@ dispose (GObject *object)
|
|||
{
|
||||
CallsMMProvider *self = CALLS_MM_PROVIDER (object);
|
||||
|
||||
g_cancellable_cancel (self->cancellable);
|
||||
g_clear_object (&self->cancellable);
|
||||
|
||||
g_clear_object (&self->mm);
|
||||
|
||||
g_clear_handle_id (&self->watch_id, g_bus_unwatch_name);
|
||||
|
|
Loading…
Reference in a new issue