There was an error while loading. Please reload this page.
1 parent b42ce64 commit 232e562Copy full SHA for 232e562
1 file changed
src/_macosx.m
@@ -572,6 +572,8 @@ bool mpl_check_modifier(bool present, PyObject* list, char const* name)
572
},
573
};
574
575
+static PyTypeObject FigureManagerType;
576
+
577
typedef struct {
578
PyObject_HEAD
579
Window* window;
@@ -686,7 +688,24 @@ bool mpl_check_modifier(bool present, PyObject* list, char const* name)
686
688
{
687
689
[self->window close];
690
self->window = NULL;
- [super destroy];
691
692
+ // call super().destroy()
693
+ PyObject *super_obj = PyObject_CallFunctionObjArgs(
694
+ (PyObject *)&PySuper_Type,
695
+ (PyObject *)FigureManagerType,
696
+ self,
697
+ NULL
698
+ );
699
+ if (super_obj == NULL) {
700
+ return NULL; // error
701
+ }
702
+ PyObject *result = PyObject_CallMethod(super_obj, "destroy", NULL);
703
+ Py_DECREF(super_obj);
704
+ if (result == NULL) {
705
706
707
+ Py_DECREF(result);
708
709
Py_RETURN_NONE;
710
}
711
0 commit comments