Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions atom/src/methodwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ namespace
void
MethodWrapper_dealloc( MethodWrapper* self )
{
PyTypeObject *tp = Py_TYPE( self );
Py_CLEAR( self->im_selfref );
Py_CLEAR( self->im_func );
Py_TYPE(self)->tp_free( pyobject_cast( self ) );
tp->tp_free( pyobject_cast( self ) );
Py_DECREF( tp );
}


Expand Down Expand Up @@ -133,10 +135,12 @@ namespace
void
AtomMethodWrapper_dealloc( AtomMethodWrapper* self )
{
PyTypeObject *tp = Py_TYPE( self );
Py_CLEAR( self->im_func );
// manual destructor since Python malloc'd and zero'd the struct
self->pointer.~CAtomPointer();
Py_TYPE(self)->tp_free( pyobject_cast( self ) );
tp->tp_free( pyobject_cast( self ) );
Py_DECREF( tp );
}


Expand Down Expand Up @@ -210,7 +214,7 @@ PyTypeObject* AtomMethodWrapper::TypeObject = NULL;

PyType_Spec AtomMethodWrapper::TypeObject_Spec = {
PACKAGE_TYPENAME( "AtomMethodWrapper" ), /* tp_name */
sizeof( MethodWrapper ), /* tp_basicsize */
sizeof( AtomMethodWrapper ), /* tp_basicsize */
0, /* tp_itemsize */
Py_TPFLAGS_DEFAULT, /* tp_flags */
AtomMethodWrapper_Type_slots /* slots */
Expand Down
2 changes: 1 addition & 1 deletion tests/test_default_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class SetTest(Atom):
5,
DefaultValue.MemberMethod_Object,
),
(ForwardTyped(lambda: int, factory=lambda: (5)), 5, DefaultValue.CallObject),
(ForwardTyped(lambda: int, factory=lambda: 5), 5, DefaultValue.CallObject),
(Instance(int, ("101",), {"base": 2}), 5, DefaultValue.CallObject),
(Instance(int, factory=lambda: 5), 5, DefaultValue.CallObject),
(
Expand Down
Loading