提交 dbe16b7d authored 作者: Frederic Bastien's avatar Frederic Bastien

fix a memory leak. We where doing INCREF 2 times on the inputs!

上级 cdd6e33e
......@@ -1013,7 +1013,6 @@ class CLinker(link.Linker):
print >> code, ' return NULL;'
print >> code, ' }'
print >> code, ' %(struct_name)s* struct_ptr = new %(struct_name)s();' %locals()
print >> code, ' ', ''.join('Py_INCREF(PyTuple_GET_ITEM(argtuple, %i));'%n for n in xrange(n_args))
print >> code, ' struct_ptr->init(', ','.join('PyTuple_GET_ITEM(argtuple, %i)'%n for n in xrange(n_args)), ');'
print >> code, ' PyObject* thunk = PyCObject_FromVoidPtrAndDesc((void*)(&%(struct_name)s_executor), struct_ptr, %(struct_name)s_destructor);' %locals()
print >> code, " return thunk; }"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论