From: Just van Rossum Date: Wed, 5 Jun 2002 17:41:03 +0000 (+0000) Subject: fixed refcount leak in CreateNewWindow() and CreateWindowFromResource(). X-Git-Tag: v2.3c1~5459 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84fca948c8e90dae94c5815d8b9ae2ff2331b676;p=python fixed refcount leak in CreateNewWindow() and CreateWindowFromResource(). --- diff --git a/Mac/Modules/win/_Winmodule.c b/Mac/Modules/win/_Winmodule.c index 250e4ed03c..30301e0b26 100644 --- a/Mac/Modules/win/_Winmodule.c +++ b/Mac/Modules/win/_Winmodule.c @@ -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; } diff --git a/Mac/Modules/win/winscan.py b/Mac/Modules/win/winscan.py index c6ba7ec0f8..cfe3eb3c33 100644 --- a/Mac/Modules/win/winscan.py +++ b/Mac/Modules/win/winscan.py @@ -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