Fix offline state signal emission
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 15 Dec 2008 08:11:05 +0000 (09:11 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 15 Dec 2008 08:11:05 +0000 (09:11 +0100)
src/element.c

index 098bbae..9b91ab0 100644 (file)
@@ -1988,7 +1988,9 @@ static gboolean remove_element(GNode *node, gpointer user_data)
        }
 
        if (element->type == CONNMAN_ELEMENT_TYPE_CONNECTION) {
-               emit_state_change(connection, "offline");
+               if (__connman_element_count(NULL,
+                                       CONNMAN_ELEMENT_TYPE_CONNECTION) == 0)
+                       emit_state_change(connection, "offline");
                emit_connections_signal(connection);
 
                g_dbus_unregister_interface(connection, element->path,