From 2824b0cbb66e715490e1ef13250bd675d87b32d9 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 2 Jun 2010 20:53:17 +0000 Subject: rel-2.0.0 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/tags/rel-2.0.0@12089 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- trunk/Examples/test-suite/python/refcount_runme.py | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 trunk/Examples/test-suite/python/refcount_runme.py (limited to 'trunk/Examples/test-suite/python/refcount_runme.py') diff --git a/trunk/Examples/test-suite/python/refcount_runme.py b/trunk/Examples/test-suite/python/refcount_runme.py new file mode 100644 index 000000000..b429404e7 --- /dev/null +++ b/trunk/Examples/test-suite/python/refcount_runme.py @@ -0,0 +1,32 @@ +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" + + +rca = b2.get_rca() +b3 = B.create(rca) + +if a.ref_count() != 5: + print "This program will crash... now" + + +v = vector_A(2) +v[0] = a +v[1] = a + +x = v[0] +del v + + + + -- cgit v1.2.1