Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccf1994

Browse files
committed
Better document super call
1 parent 774d02c commit ccf1994

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/_macosx.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ bool mpl_check_modifier(bool present, PyObject* list, char const* name)
572572
},
573573
};
574574

575-
static PyTypeObject FigureManagerType;
575+
static PyTypeObject FigureManagerType; // forward declaration, needed in destroy()
576576

577577
typedef struct {
578578
PyObject_HEAD
@@ -689,7 +689,8 @@ bool mpl_check_modifier(bool present, PyObject* list, char const* name)
689689
[self->window close];
690690
self->window = NULL;
691691

692-
// call super().destroy()
692+
// call super(self, FigureManager).destroy() - it seems we need the
693+
// explicit arguments, and just super() doesn't work in the C API.
693694
PyObject *super_obj = PyObject_CallFunctionObjArgs(
694695
(PyObject *)&PySuper_Type,
695696
(PyObject *)&FigureManagerType,

0 commit comments

Comments
 (0)