[issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory

2017-11-08 Thread Berker Peksag
Berker Peksag added the comment: See also issue 12998. -- ___ Python tracker ___

[issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory

2017-11-08 Thread Berker Peksag
Berker Peksag added the comment: I agree with Terry. Your code calls hi() in an infinite loop (why timespec is defined in hi()?), we don't know how clock_gettime(3) is implemented etc. (it should cleanup its own memory if it calls malloc()) etc. Please use python-list

[issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory

2017-11-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: The tracker is for patching CPython. Please consider closing this and asking your question on python-list. When you post code, do so only once, and without line numbers, so it can be copied and run as is. Do include data on the ref

[issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory

2017-10-29 Thread Yang Big
New submission from Yang Big : Here my code: 2 import sys 3 import ctypes 4 5 6 def hi(): 7 class timespec(ctypes.Structure): 8 ┆ """Time specification, as described in clock_gettime(3).""" 9 ┆ _fields_ = (('tv_sec',