]> granicus.if.org Git - python/commitdiff
fixed refcount leak in CreateNewWindow() and CreateWindowFromResource().
authorJust van Rossum <just@letterror.com>
Wed, 5 Jun 2002 17:41:03 +0000 (17:41 +0000)
committerJust van Rossum <just@letterror.com>
Wed, 5 Jun 2002 17:41:03 +0000 (17:41 +0000)
Mac/Modules/win/_Winmodule.c
Mac/Modules/win/winscan.py

index 250e4ed03c2689ed1cc4e1df0aa306ade8e831e1..30301e0b26abf10baa1d8f11a9638b6e48401e7e 100644 (file)
@@ -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;
 }
 
index c6ba7ec0f8d70c3e234939190661d2aea2f27b3e..cfe3eb3c33ac6a7d75380bff72635b04e4568db9 100644 (file)
@@ -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