Move to kernel style SPDX license identifiers
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt_graph.i.h
index e45fea610df5a886b186c67bb90ab799eedd7704..41569f3d6a4ae0cb0b1e4e6c1675b37e9174e29b 100644 (file)
@@ -1,34 +1,9 @@
 /*
- * 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,
@@ -145,7 +120,7 @@ PyObject *bt_bt2_graph_add_port_added_listener(struct bt_graph *graph,
        /* 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
@@ -167,7 +142,7 @@ PyObject *bt_bt2_graph_add_port_added_listener(struct bt_graph *graph,
        /* 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
@@ -189,7 +164,7 @@ PyObject *bt_bt2_graph_add_port_added_listener(struct bt_graph *graph,
        /* 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
@@ -211,7 +186,7 @@ PyObject *bt_bt2_graph_add_port_added_listener(struct bt_graph *graph,
        /* 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
@@ -229,12 +204,6 @@ PyObject *bt_bt2_graph_add_port_added_listener(struct bt_graph *graph,
 
        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:
This page took 0.023739 seconds and 4 git commands to generate.