New submission from Armin Rigo:

It's hard to tell for sure, given the lack of precise definition, but I
believe that the attached piece of code "should" work.  What it does is
make p1 point to c_long(20).  So ctypes should probably keep the
c_long(20) alive as long as p1 is alive (and not further modified). 
This test shows that the c_long(20) gets freed instead, making the
p1.contents reference garbage.

----------
components: Extension Modules
files: x.py
messages: 62429
nosy: arigo
severity: normal
status: open
title: ctypes pointer not always keeping target alive
Added file: http://bugs.python.org/file9436/x.py

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2123>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to