Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: d48ecebad5ac78a1783e09b0d32c211d9754edf4 authored by Ned Deily on 19 December 2017, 04:53:56 UTC
Update to 3.6.4
Tip revision: d48eceb
test_ctypes.py

# Taken from Lib/ctypes/test/test_keeprefs.py, PointerToStructure.test().

from ctypes import Structure, c_int, POINTER
import gc

def leak_inner():
    class POINT(Structure):
        _fields_ = [("x", c_int)]
    class RECT(Structure):
        _fields_ = [("a", POINTER(POINT))]

def leak():
    leak_inner()
    gc.collect()
back to top