Fix use after unlink in XML::Node#16432
Conversation
|
The iteration and call the I believe Maybe it should behave like |
|
What's wrong about keeping the node? Following |
|
I wrongly thought that |
XML::Node
|
thanks! |
Reverts 85a60cd. Requires Crystal version >= 1.19.1. See: - crystal-lang/crystal#16414 - crystal-lang/crystal#16418 - crystal-lang/crystal#16419 - crystal-lang/crystal#16432
Reverts 85a60cd. Requires Crystal version >= 1.19.1. See: - crystal-lang/crystal#16414 - crystal-lang/crystal#16418 - crystal-lang/crystal#16419 - crystal-lang/crystal#16432
This code works because attributes only have a single text node in practice, but the use after unlink is troublesome. The code also checks (
obj = cached?(node)) the parent when iterating over the children. There is no memory leak here, but I am including the PR since I think it brings the implementation in line with the name of the method.