Adding test_multiple_registered_instances_for_same_pointee_leak. Subtle changes in smart_holder_type_caster_load, trying to work on weak_ptr for shared_ptr_trampoline_self_life_support, but that didn't work out. Manually fully leak-checked again.

This commit is contained in:
Ralf W. Grosse-Kunstleve
2021-06-29 15:17:11 -07:00
committed by Ralf W. Grosse-Kunstleve
parent 595f7f4f6e
commit a021e045a9
3 changed files with 44 additions and 21 deletions

View File

@@ -170,6 +170,20 @@ def test_multiple_registered_instances_for_same_pointee():
assert obj_pt.attachment_in_dict == "Obj0"
else:
assert not hasattr(obj_pt, "attachment_in_dict")
assert obj0.history == "PySft"
break # Comment out for manual leak checking (use `top` command).
def test_multiple_registered_instances_for_same_pointee_leak():
obj0 = PySft("")
while True:
stash1 = m.SftSharedPtrStash(1)
stash1.Add(m.Sft(obj0))
assert stash1.use_count(0) == 1
stash1.Add(m.Sft(obj0))
assert stash1.use_count(0) == 1
assert stash1.use_count(1) == 1
assert obj0.history == ""
break # Comment out for manual leak checking (use `top` command).

View File

@@ -130,7 +130,7 @@ def test_infinite():
tester = m.SpBaseTester()
while True:
tester.set_object(m.SpBase())
return # Comment out for manual leak checking (use `top` command).
break # Comment out for manual leak checking (use `top` command).
def test_std_make_shared_factory():
@@ -139,4 +139,6 @@ def test_std_make_shared_factory():
super(PyChild, self).__init__(0)
obj = PyChild()
assert m.pass_through_shd_ptr(obj) is obj
while True:
assert m.pass_through_shd_ptr(obj) is obj
break # Comment out for manual leak checking (use `top` command).