[Python-checkins] python/dist/src/Mac/Modules/win _Winmodule.c,1.9,1.10 winscan.py,1.20,1.21

jvr@users.sourceforge.net jvr@users.sourceforge.net
Wed, 05 Jun 2002 10:41:11 -0700


Update of /cvsroot/python/python/dist/src/Mac/Modules/win
In directory usw-pr-cvs1:/tmp/cvs-serv514

Modified Files:
	_Winmodule.c winscan.py 
Log Message:
fixed refcount leak in CreateNewWindow() and CreateWindowFromResource().

Index: _Winmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/_Winmodule.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** _Winmodule.c	23 Apr 2002 22:42:40 -0000	1.9
--- _Winmodule.c	5 Jun 2002 17:41:03 -0000	1.10
***************
*** 3113,3117 ****
  	if (_err != noErr) return PyMac_Error(_err);
  	_res = Py_BuildValue("O&",
! 	                     WinObj_WhichWindow, outWindow);
  	return _res;
  }
--- 3113,3117 ----
  	if (_err != noErr) return PyMac_Error(_err);
  	_res = Py_BuildValue("O&",
! 	                     WinObj_New, outWindow);
  	return _res;
  }
***************
*** 3133,3137 ****
  	if (_err != noErr) return PyMac_Error(_err);
  	_res = Py_BuildValue("O&",
! 	                     WinObj_WhichWindow, outWindow);
  	return _res;
  }
--- 3133,3137 ----
  	if (_err != noErr) return PyMac_Error(_err);
  	_res = Py_BuildValue("O&",
! 	                     WinObj_New, outWindow);
  	return _res;
  }

Index: winscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/winscan.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** winscan.py	24 Mar 2002 23:01:16 -0000	1.20
--- winscan.py	5 Jun 2002 17:41:03 -0000	1.21
***************
*** 137,140 ****
--- 137,147 ----
  			 [("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", "*", "*")]),