Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit indexing operators and fix leaks and crashes #548

Conversation

elijah-semyonov
Copy link
Contributor

@elijah-semyonov elijah-semyonov commented Sep 26, 2024

Fix #543 and #531
Reduce performance checks iterations x10.
Fix dictionary leaks and a crash when dictionary[key] = nil

@@ -273,7 +273,8 @@ public class Variant: Hashable, Equatable, CustomDebugStringConvertible {
if valid == 0 || oob != 0 {
return nil
}
return Variant(copying: _result)

return Variant(takingOver: _result)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably add a comment here. Unlike Array, that gives a pointer to its internal storage, this API returns a copy.

@migueldeicaza migueldeicaza merged commit 55637fe into migueldeicaza:main Sep 27, 2024
2 checks passed
@elijah-semyonov elijah-semyonov deleted the fix-crashes-and-leaks-and-whatnot branch September 28, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Godot String via Variant subscript operator leaks
2 participants