iterator = container_of(obj, struct bt_notification_iterator,
base);
assert(iterator->user_destroy || !iterator->user_data);
- iterator->user_destroy(iterator);
+ if (iterator->user_destroy) {
+ iterator->user_destroy(iterator);
+ }
+ BT_PUT(iterator->component);
g_free(iterator);
}
goto end;
}
+ iterator->component = bt_get(component);
bt_object_init(iterator, bt_notification_iterator_destroy);
end:
return iterator;
end:
return ret;
}
+
+struct bt_component *bt_notification_iterator_get_component(
+ struct bt_notification_iterator *iterator)
+{
+ return bt_get(iterator->component);
+}
+