Patches item #1643874, was opened at 2007-01-24 22:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1643874&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Thomas Heller (theller)
Assigned to: Thomas Heller (theller)
Summary: ctypes leaks memory
Initial Comment:
This program leaks memory, because a string is allocated with the win32 call
SysAllocString(), but SysFreeString() is never called.
"""
from ctypes import oledll, _SimpleCData
class BSTR(_SimpleCData):
_type_ = "X"
func = oledll.oleaut32.SysStringLen
func.argtypes = (BSTR,)
while 1:
func("abcdefghijk")
"""
The attached patch fixes this.
(The BSTR data type is not exposed by ctypes or ctypes.wintypes, because it is
only used in connection with Windows COM objects.)
The patch should be applied to release25-maint and trunk.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1643874&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches