summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/win
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2002-06-05 17:41:03 (GMT)
committerJust van Rossum <just@letterror.com>2002-06-05 17:41:03 (GMT)
commit84fca948c8e90dae94c5815d8b9ae2ff2331b676 (patch)
tree614a3aa54362ab4dc0271cb21ad5d2b62ab8dee7 /Mac/Modules/win
parentaee2d5f975dfa53fb270439d9e09d542d8ea765f (diff)
downloadcpython-84fca948c8e90dae94c5815d8b9ae2ff2331b676.zip
cpython-84fca948c8e90dae94c5815d8b9ae2ff2331b676.tar.gz
cpython-84fca948c8e90dae94c5815d8b9ae2ff2331b676.tar.bz2
fixed refcount leak in CreateNewWindow() and CreateWindowFromResource().
Diffstat (limited to 'Mac/Modules/win')
-rw-r--r--Mac/Modules/win/_Winmodule.c4
-rw-r--r--Mac/Modules/win/winscan.py7
2 files changed, 9 insertions, 2 deletions
diff --git a/Mac/Modules/win/_Winmodule.c b/Mac/Modules/win/_Winmodule.c
index 250e4ed..30301e0 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 c6ba7ec..cfe3eb3 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