Commit 84fca948 authored by Just van Rossum's avatar Just van Rossum

fixed refcount leak in CreateNewWindow() and CreateWindowFromResource().

parent aee2d5f9
......@@ -3112,7 +3112,7 @@ static PyObject *Win_CreateNewWindow(PyObject *_self, PyObject *_args)
&outWindow);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
WinObj_WhichWindow, outWindow);
WinObj_New, outWindow);
return _res;
}
......@@ -3132,7 +3132,7 @@ static PyObject *Win_CreateWindowFromResource(PyObject *_self, PyObject *_args)
&outWindow);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
WinObj_WhichWindow, outWindow);
WinObj_New, outWindow);
return _res;
}
......
......@@ -136,6 +136,13 @@ class MyScanner(Scanner):
([("void", "wStorage", "OutMode")],
[("NullStorage", "*", "InMode")]),
# match FindWindowOfClass
([("WindowRef", "outWindow", "OutMode"), ("WindowPartCode", "outWindowPart", "OutMode")],
[("ExistingWindowPtr", "*", "OutMode"), ("WindowPartCode", "outWindowPart", "OutMode")]),
# then match CreateNewWindow and CreateWindowFromResource
([("WindowRef", "outWindow", "OutMode")],
[("WindowRef", "*", "*")]),
([("WindowPtr", "*", "OutMode")],
[("ExistingWindowPtr", "*", "*")]),
([("WindowRef", "*", "OutMode")], # Same, but other style headerfiles
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment