device: Fix an inbalance ref/unref of network objects
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 21 Jun 2011 14:45:50 +0000 (16:45 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 21 Jun 2011 14:45:50 +0000 (16:45 +0200)
The destroy callback of the hash table (device->networks)
will unref and unregister the network object.

src/device.c

index 3e3e96d..6e52164 100644 (file)
@@ -1072,6 +1072,8 @@ int connman_device_add_network(struct connman_device *device,
        if (identifier == NULL)
                return -EINVAL;
 
+       connman_network_ref(network);
+
        __connman_network_set_device(network, device);
 
        g_hash_table_insert(device->networks, g_strdup(identifier),