+
+ /*
+ * Free the user data Python object attached to the port. The
+ * corresponding incref was done by the `void *` typemap in
+ * native_bt_port.i.
+ */
+ for (i = 0; i < bt_component_filter_get_input_port_count(component_filter); i++) {
+ bt_self_component_port_input *port_input;
+
+ port_input = bt_self_component_filter_borrow_input_port_by_index(
+ self_component_filter, i);
+
+ delete_port_input_user_data(port_input);
+ }
+
+ for (i = 0; i < bt_component_filter_get_output_port_count(component_filter); i++) {
+ bt_self_component_port_output *port_output;
+
+ port_output = bt_self_component_filter_borrow_output_port_by_index(
+ self_component_filter, i);
+
+ delete_port_output_user_data(port_output);
+ }