mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-12 01:10:34 +00:00
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:
committed by
Ralf W. Grosse-Kunstleve
parent
595f7f4f6e
commit
a021e045a9
@@ -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).
|
||||
|
||||
|
||||
|
||||
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user