added refcount example using the old macro way and the proposed ref/unref features
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5667 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
baf05fd515
commit
55e0ea52bd
4 changed files with 339 additions and 0 deletions
15
SWIG/Examples/test-suite/python/refcount_runme.py
Normal file
15
SWIG/Examples/test-suite/python/refcount_runme.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from refcount import *
|
||||
#
|
||||
# very innocent example
|
||||
#
|
||||
|
||||
a = A3()
|
||||
b1 = B(a)
|
||||
b2 = B.create(a)
|
||||
|
||||
|
||||
|
||||
if a.ref_count() != 3:
|
||||
print "This program will crash... now"
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue