diff --git a/gio/gnetworkmonitorbase.c b/gio/gnetworkmonitorbase.c index be6ec7277..d503759c1 100644 --- a/gio/gnetworkmonitorbase.c +++ b/gio/gnetworkmonitorbase.c @@ -496,11 +496,9 @@ void g_network_monitor_base_add_network (GNetworkMonitorBase *monitor, GInetAddressMask *network) { - if (!g_hash_table_add (monitor->priv->networks, network)) + if (!g_hash_table_add (monitor->priv->networks, g_object_ref (network))) return; - g_object_ref (network); /* for the element now stored in the hash table */ - if (g_inet_address_mask_get_length (network) == 0) { switch (g_inet_address_mask_get_family (network))