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

Skip to content

Commit 55eb007

Browse files
committed
Call super().destroy() in _maxosx.m FigureManager
1 parent b42ce64 commit 55eb007

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/_macosx.m

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,24 @@ bool mpl_check_modifier(bool present, PyObject* list, char const* name)
686686
{
687687
[self->window close];
688688
self->window = NULL;
689-
[super destroy];
689+
690+
// call super().destroy()
691+
PyObject *super_obj = PyObject_CallFunctionObjArgs(
692+
(PyObject *)&PySuper_Type,
693+
(PyObject *)Py_TYPE(self), // current class
694+
self, // instance
695+
NULL
696+
);
697+
if (super_obj == NULL) {
698+
return NULL; // error
699+
}
700+
PyObject *result = PyObject_CallMethod(super_obj, "destroy", NULL);
701+
Py_DECREF(super_obj);
702+
if (result == NULL) {
703+
return NULL; // error
704+
}
705+
Py_DECREF(result);
706+
690707
Py_RETURN_NONE;
691708
}
692709

0 commit comments

Comments
 (0)