From f6ba5a41da56aabcd0c337b1bd3fcaf36923d889 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 4 Mar 2001 15:57:47 +0000 Subject: [PATCH] Use PyObject_INIT() instead of trying to hand-initialize [SVN r9419] --- src/extension_class.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/extension_class.cpp b/src/extension_class.cpp index 47862ec7..f71976b9 100644 --- a/src/extension_class.cpp +++ b/src/extension_class.cpp @@ -7,7 +7,7 @@ // producing this work. // // Revision History: -// Mar 01 01 Use PyObject_INIT() instead of trying to hand-initialize (David Abrahams) +// 04 Mar 01 Use PyObject_INIT() instead of trying to hand-initialize (David Abrahams) #include #include @@ -463,7 +463,9 @@ operator_dispatcher::create(const ref& object, const ref& self) free_list = result->m_free_list_link; result->m_object = object; result->m_self = self; - Py_INCREF(result); + + PyObject* result_as_pyobject = result; + PyObject_INIT(result_as_pyobject, &type_obj); return result; }