wwan/ofono: clean up g_clear_object() usage

This commit is contained in:
Dan Williams
2016-06-17 15:38:57 -05:00
committed by Thomas Haller
parent 58ab8c9316
commit 219904920f

View File

@@ -1057,7 +1057,6 @@ context_proxy_new_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_dat
* clear it so that we can gate getting the IP config from oFono * clear it so that we can gate getting the IP config from oFono
* on whether or not we have already received them * on whether or not we have already received them
*/ */
if (priv->ip4_config)
g_clear_object (&priv->ip4_config); g_clear_object (&priv->ip4_config);
/* Watch for custom ofono PropertyChanged signals */ /* Watch for custom ofono PropertyChanged signals */
@@ -1092,7 +1091,6 @@ do_context_activate (NMModemOfono *self)
g_value_init (&value, G_TYPE_BOOLEAN); g_value_init (&value, G_TYPE_BOOLEAN);
g_value_set_boolean (&value, TRUE); g_value_set_boolean (&value, TRUE);
if (priv->context_proxy)
g_clear_object (&priv->context_proxy); g_clear_object (&priv->context_proxy);
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
@@ -1151,9 +1149,7 @@ act_stage1_prepare (NMModem *modem,
nm_log_dbg (LOGD_MB, " trying %s %s", id[1], id[2]); nm_log_dbg (LOGD_MB, " trying %s %s", id[1], id[2]);
if (priv->context_path)
g_free (priv->context_path); g_free (priv->context_path);
priv->context_path = g_strdup_printf ("%s/%s", priv->context_path = g_strdup_printf ("%s/%s",
nm_modem_get_path (modem), nm_modem_get_path (modem),
id[2]); id[2]);
@@ -1257,7 +1253,6 @@ dispose (GObject *object)
priv->connect_properties = NULL; priv->connect_properties = NULL;
} }
if (priv->ip4_config)
g_clear_object (&priv->ip4_config); g_clear_object (&priv->ip4_config);
if (priv->modem_proxy) { if (priv->modem_proxy) {
@@ -1265,9 +1260,7 @@ dispose (GObject *object)
g_clear_object (&priv->modem_proxy); g_clear_object (&priv->modem_proxy);
} }
if (priv->connman_proxy)
g_clear_object (&priv->connman_proxy); g_clear_object (&priv->connman_proxy);
if (priv->context_proxy)
g_clear_object (&priv->context_proxy); g_clear_object (&priv->context_proxy);
if (priv->sim_proxy) { if (priv->sim_proxy) {
@@ -1275,10 +1268,8 @@ dispose (GObject *object)
g_clear_object (&priv->sim_proxy); g_clear_object (&priv->sim_proxy);
} }
if (priv->imsi) {
g_free (priv->imsi); g_free (priv->imsi);
priv->imsi = NULL; priv->imsi = NULL;
}
G_OBJECT_CLASS (nm_modem_ofono_parent_class)->dispose (object); G_OBJECT_CLASS (nm_modem_ofono_parent_class)->dispose (object);
} }