Benjamin Peterson added the comment:

cast() always creates a ref cycle, which is probably what you are seeing.

>>> from ctypes import c_double, cast, POINTER
>>> samples = (c_double*23)()
>>> cast(samples, POINTER(c_double))
<__main__.LP_c_double object at 0x7f33bc920560>
>>> samples._objects
{139860183544448: <__main__.c_double_Array_23 object at 0x7f33bc8ef280>}
>>> samples
<__main__.c_double_Array_23 object at 0x7f33bc8ef280>

----------
nosy: +benjamin.peterson

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25512>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to