Skip to content

Commit

Permalink
Merge pull request #1322 from cnheitman/fix/fix-python-binding
Browse files Browse the repository at this point in the history
Fix addCallback binding
  • Loading branch information
JonathanSalwan committed May 6, 2024
2 parents 722d900 + e6fe51b commit 6474d96
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/libtriton/bindings/python/objects/pyTritonContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<triton::callbacks::callback_e>(PyLong_AsUint32(mode))) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 6474d96

Please sign in to comment.