import source from 1.3.40
[external/swig.git] / Examples / test-suite / python / refcount_runme.py
1 from refcount import *
2 #
3 # very innocent example
4 #
5
6 a = A3()
7 b1 = B(a)
8 b2 = B.create(a)
9
10
11
12 if a.ref_count() != 3:
13   print "This program will crash... now"
14
15
16 rca = b2.get_rca()
17 b3 = B.create(rca)
18
19 if a.ref_count() != 5:
20   print "This program will crash... now"
21
22
23 v = vector_A(2)
24 v[0] = a
25 v[1] = a
26
27 x = v[0]
28 del v
29
30
31
32