/*
- * The MIT License (MIT)
+ * SPDX-License-Identifier: MIT
*
* Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
*/
-static
-void graph_listener_removed(void *py_callable)
-{
- BT_ASSERT(py_callable);
- Py_DECREF(py_callable);
-}
-
static bt_graph_listener_func_status port_added_listener(
const void *component,
swig_type_info *component_swig_type,
/* source output port */
status = bt_graph_add_source_component_output_port_added_listener(
graph, source_component_output_port_added_listener,
- graph_listener_removed, py_callable, &listener_id);
+ py_callable, &listener_id);
if (status != __BT_FUNC_STATUS_OK) {
/*
* bt_graph_add_source_component_output_port_added_listener has
/* filter input port */
status = bt_graph_add_filter_component_input_port_added_listener(
graph, filter_component_input_port_added_listener,
- graph_listener_removed, py_callable, &listener_id);
+ py_callable, &listener_id);
if (status != __BT_FUNC_STATUS_OK) {
/*
* bt_graph_add_filter_component_input_port_added_listener has
/* filter output port */
status = bt_graph_add_filter_component_output_port_added_listener(
graph, filter_component_output_port_added_listener,
- graph_listener_removed, py_callable, &listener_id);
+ py_callable, &listener_id);
if (status != __BT_FUNC_STATUS_OK) {
/*
* bt_graph_add_filter_component_output_port_added_listener has
/* sink input port */
status = bt_graph_add_sink_component_input_port_added_listener(
graph, sink_component_input_port_added_listener,
- graph_listener_removed, py_callable, &listener_id);
+ py_callable, &listener_id);
if (status != __BT_FUNC_STATUS_OK) {
/*
* bt_graph_add_sink_component_input_port_added_listener has
PyTuple_SET_ITEM(py_listener_ids, 3, py_listener_id);
py_listener_id = NULL;
-
- Py_INCREF(py_callable);
- Py_INCREF(py_callable);
- Py_INCREF(py_callable);
- Py_INCREF(py_callable);
-
goto end;
error: