gdbusproxy: Tidy up some memory management code

Use `g_clear_object()` to tidy things up. This introduces no functional
changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-02-20 11:23:50 +00:00
parent 72afc79346
commit d9dab2b319

View File

@ -889,8 +889,7 @@ on_signal_received (GDBusConnection *connection,
parameters);
out:
if (proxy != NULL)
g_object_unref (proxy);
g_clear_object (&proxy);
}
/* ---------------------------------------------------------------------------------------------------- */
@ -1101,11 +1100,9 @@ on_properties_changed (GDBusConnection *connection,
}
out:
if (changed_properties != NULL)
g_variant_unref (changed_properties);
g_clear_pointer (&changed_properties, g_variant_unref);
g_free (invalidated_properties);
if (proxy != NULL)
g_object_unref (proxy);
g_clear_object (&proxy);
}
/* ---------------------------------------------------------------------------------------------------- */
@ -1357,8 +1354,7 @@ on_name_owner_changed (GDBusConnection *connection,
}
out:
if (proxy != NULL)
g_object_unref (proxy);
g_clear_object (&proxy);
}
/* ---------------------------------------------------------------------------------------------------- */