Skip to content
Snippets Groups Projects
Commit c4928553 authored by Simon Désaulniers's avatar Simon Désaulniers Committed by Adrien Béraud
Browse files

python: fix successive deref on cython object

parent 48b0cff0
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,6 @@ cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* val ...@@ -50,7 +50,6 @@ cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* val
v._value = val v._value = val
vals.append(v) vals.append(v)
cbs['lookup'](vals, p.toString()) cbs['lookup'](vals, p.toString())
ref.Py_DECREF(cbs)
cdef inline void shutdown_callback(void* user_data) with gil: cdef inline void shutdown_callback(void* user_data) with gil:
cbs = <object>user_data cbs = <object>user_data
...@@ -435,6 +434,7 @@ cdef class Pht(object): ...@@ -435,6 +434,7 @@ cdef class Pht(object):
done_cb -- Called when the operation is completed. done_cb -- Called when the operation is completed.
""" """
cb_obj = {'done':done_cb} cb_obj = {'done':done_cb}
ref.Py_INCREF(cb_obj)
cdef cpp.IndexKey cppk cdef cpp.IndexKey cppk
for kk, v in key.items(): for kk, v in key.items():
cppk[bytes(kk, 'utf-8')] = cpp.Prefix(bytes(v)) cppk[bytes(kk, 'utf-8')] = cpp.Prefix(bytes(v))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment