auth-provider: fix reference count in manager and modem objects

The auth provider is now a singleton (since 20ab6550), one single
object that lives throughout the whole program execution, and so we
don't need to keep our own full references around. This fix makes
sure we don't attempt to unref a full auth provider reference we
don't own.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/179
This commit is contained in:
Aleksander Morgado
2020-01-28 10:32:11 +01:00
parent 2406a5519f
commit 4bfd955e64
2 changed files with 3 additions and 3 deletions

View File

@@ -1558,8 +1558,7 @@ finalize (GObject *object)
if (priv->connection)
g_object_unref (priv->connection);
if (priv->authp)
g_object_unref (priv->authp);
/* note: authp is a singleton, we don't keep a full reference */
if (priv->authp_cancellable)
g_object_unref (priv->authp_cancellable);

View File

@@ -1651,7 +1651,8 @@ dispose (GObject *object)
/* Cancel all ongoing auth requests */
g_cancellable_cancel (self->priv->authp_cancellable);
g_clear_object (&self->priv->authp_cancellable);
g_clear_object (&self->priv->authp);
/* note: authp is a singleton, we don't keep a full reference */
/* Ensure we cancel any ongoing operation, but before
* disconnect our own signal handler, or we'll end up with