You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
619 B

  1. from __future__ import print_function
  2. import sys
  3. import gc
  4. sys.path.append('.')
  5. from example import Parent, Child
  6. if True:
  7. p = Parent()
  8. p.addChild(Child())
  9. gc.collect()
  10. print(p)
  11. p = None
  12. gc.collect()
  13. print("")
  14. if True:
  15. p = Parent()
  16. p.returnChild()
  17. gc.collect()
  18. print(p)
  19. p = None
  20. gc.collect()
  21. print("")
  22. if True:
  23. p = Parent()
  24. p.addChildKeepAlive(Child())
  25. gc.collect()
  26. print(p)
  27. p = None
  28. gc.collect()
  29. print("")
  30. if True:
  31. p = Parent()
  32. p.returnChildKeepAlive()
  33. gc.collect()
  34. print(p)
  35. p = None
  36. gc.collect()
  37. print("")
  38. print("Terminating..")