mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 20:35:31 +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
79401f6227
commit
662befeb48
1 changed files with 10 additions and 1 deletions
|
@ -50,6 +50,8 @@ struct _CallsMMProvider {
|
||||||
MMManager *mm;
|
MMManager *mm;
|
||||||
/* A list of CallsOrigins */
|
/* A list of CallsOrigins */
|
||||||
GListStore *origins;
|
GListStore *origins;
|
||||||
|
|
||||||
|
GCancellable *cancellable;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void calls_mm_provider_message_source_interface_init (CallsMessageSourceInterface *iface);
|
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_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,
|
mm_manager_new (connection,
|
||||||
G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
|
G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
|
||||||
NULL,
|
self->cancellable,
|
||||||
(GAsyncReadyCallback) mm_manager_new_cb,
|
(GAsyncReadyCallback) mm_manager_new_cb,
|
||||||
self);
|
self);
|
||||||
}
|
}
|
||||||
|
@ -390,6 +396,9 @@ dispose (GObject *object)
|
||||||
{
|
{
|
||||||
CallsMMProvider *self = CALLS_MM_PROVIDER (object);
|
CallsMMProvider *self = CALLS_MM_PROVIDER (object);
|
||||||
|
|
||||||
|
g_cancellable_cancel (self->cancellable);
|
||||||
|
g_clear_object (&self->cancellable);
|
||||||
|
|
||||||
g_clear_object (&self->mm);
|
g_clear_object (&self->mm);
|
||||||
|
|
||||||
g_clear_handle_id (&self->watch_id, g_bus_unwatch_name);
|
g_clear_handle_id (&self->watch_id, g_bus_unwatch_name);
|
||||||
|
|
Loading…
Reference in a new issue