X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Fgraph%2Fconnection.c;fp=lib%2Fgraph%2Fconnection.c;h=10f8074762f3d14c84438c884cabc38271b696bf;hb=3fea54f69edd1780566230255da196cb6e82df62;hp=91d130edcf6c9147bcfac3f36ae69bde57bcc8b9;hpb=baa56d0a4425a4865c638faaed4728ece07d59c7;p=babeltrace.git diff --git a/lib/graph/connection.c b/lib/graph/connection.c index 91d130ed..10f80747 100644 --- a/lib/graph/connection.c +++ b/lib/graph/connection.c @@ -79,9 +79,9 @@ void bt_connection_destroy(struct bt_object *obj) static void bt_connection_try_remove_from_graph(struct bt_connection *connection) { - void *graph = bt_object_borrow_parent(&connection->base); + void *graph = (void *) bt_object_borrow_parent(&connection->base); - if (connection->base.ref_count.count > 0 || + if (connection->base.ref_count > 0 || connection->downstream_port || connection->upstream_port || connection->iterators->len > 0) { @@ -151,8 +151,9 @@ struct bt_connection *bt_connection_create( goto end; } - bt_object_init(connection, bt_connection_destroy); - bt_object_set_parent_is_owner_listener(connection, + bt_object_init_shared_with_parent(&connection->base, + bt_connection_destroy); + bt_object_set_parent_is_owner_listener_func(&connection->base, bt_connection_parent_is_owner); connection->iterators = g_ptr_array_new(); if (!connection->iterators) { @@ -168,7 +169,7 @@ struct bt_connection *bt_connection_create( bt_port_set_connection(upstream_port, connection); BT_LOGD_STR("Setting downstream port's connection."); bt_port_set_connection(downstream_port, connection); - bt_object_set_parent(connection, &graph->base); + bt_object_set_parent(&connection->base, &graph->base); BT_LOGD("Created connection: " "graph-addr=%p, upstream-port-addr=%p, uptream-port-name=\"%s\", " "downstream-port-addr=%p, downstream-port-name=\"%s\", "