fix: avoid corruption after using test_load #1063
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using
test_load
on a loaded object the object list ends up corrupted. The details are obscure, but doing this reproduces the error:find_object()
andchildren()
return the single existing objecttest_load
on the object. At this pointfind_object()
will probably return0
(sometimes it doesn't)load_object()
again.children()
will now return an array with two duplicates of the same object or, sometimes, a0
and the existing copy of the objectIn some instances i've seen different objects returned by
children()
than the one being passed as path (this usually happened with clones).This PR tries to work around it. I've also reverted #843 because I believe this PR fixes the underlying cause for the issue, not just the symptom.
All credit goes to Zoilder (one of the developers on our mud) that happened to fix this a long time ago. We're just sending these fixes upstream since we're starting to update our outdated driver.
Please let me know if there's anything I should change in the PR. I've tried to add a proper test for this, but I don't know if that's the location you're expecting for it.