blob: 187ad534fec71419fcdf12d352d0eedadd78b7d4 [file] [log] [blame]
Wenzel Jakob5f218b32016-01-17 22:36:39 +01001from __future__ import print_function
2import sys
3import gc
4sys.path.append('.')
5
6from example import Parent, Child
7
8if True:
9 p = Parent()
10 p.addChild(Child())
11 gc.collect()
12 print(p)
13 p = None
14
15gc.collect()
16print("")
17
18if True:
19 p = Parent()
20 p.returnChild()
21 gc.collect()
22 print(p)
23 p = None
24
25gc.collect()
26print("")
27
28if True:
29 p = Parent()
30 p.addChildKeepAlive(Child())
31 gc.collect()
32 print(p)
33 p = None
Glen Walkerf45bb582016-08-16 17:50:43 +120034
Wenzel Jakob5f218b32016-01-17 22:36:39 +010035gc.collect()
36print("")
37
38if True:
39 p = Parent()
40 p.returnChildKeepAlive()
41 gc.collect()
42 print(p)
43 p = None
44
45gc.collect()
46print("")
Glen Walkerf45bb582016-08-16 17:50:43 +120047
48if True:
49 p = Parent()
50 p.returnNullChildKeepAliveChild()
51 gc.collect()
52 print(p)
53 p = None
54
55gc.collect()
56print("")
57
58if True:
59 p = Parent()
60 p.returnNullChildKeepAliveParent()
61 gc.collect()
62 print(p)
63 p = None
64
65gc.collect()
66print("")
Wenzel Jakob5f218b32016-01-17 22:36:39 +010067print("Terminating..")