From e6fe51bc4a8fd95dbdb39e87afd0f483a792cd93 Mon Sep 17 00:00:00 2001 From: Christian Heitman Date: Tue, 30 Apr 2024 16:16:37 -0300 Subject: [PATCH] Fix addCallback/removeCallback binding --- src/libtriton/bindings/python/objects/pyTritonContext.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libtriton/bindings/python/objects/pyTritonContext.cpp b/src/libtriton/bindings/python/objects/pyTritonContext.cpp index 6c54309da..f05db4d90 100644 --- a/src/libtriton/bindings/python/objects/pyTritonContext.cpp +++ b/src/libtriton/bindings/python/objects/pyTritonContext.cpp @@ -503,13 +503,10 @@ namespace triton { if (PyMethod_Check(function)) { cb_self = PyMethod_GET_SELF(function); cb = PyMethod_GET_FUNCTION(function); - - Py_INCREF(cb_self); } else { cb = function; } - Py_INCREF(cb); try { switch (static_cast(PyLong_AsUint32(mode))) { @@ -2621,11 +2618,6 @@ namespace triton { return PyErr_Format(PyExc_TypeError, "%s", e.what()); } - Py_DECREF(cb); - if (cb_self != nullptr) { - Py_DECREF(cb_self); - } - Py_INCREF(Py_None); return Py_None; }