-
-
Notifications
You must be signed in to change notification settings - Fork 23.6k
[GDScript 2.0] Don't double-reference Refs returned from function #53135
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
Conversation
7216543 to
b11cd0d
Compare
b11cd0d to
0647008
Compare
0647008 to
6141ce2
Compare
|
The current version looks pretty clean, kudos. I'll let @vnen review/confirm that it's the best approach. |
|
Poke @vnen. |
|
I checked #52699 and with my original code some instances are still leaked with the typed line. So it fixes only half of the issue. |
vnen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks okay to me. I guess this a bit tricky to wrap the head around since there's a lot going on under the hood.
I wonder if we should restore the set_object() function that I removed in #43992, though having one just for updating the ID should be good enough.
Maybe a comment here about the reference counting would be handy so it isn't wrongly changed in the future.
|
Thanks! |
GDScript 2.0 opcode
OPCODE_CALL_PTRCALL_OBJECTwill double-reference returnedRefs. This results in a memory leak.This change fixes that issue while still keeping the fixes of #43992
Fixes #53093
Fixes #52699
(both issues are the same underlying bug)
@vnen Requesting review to make sure there are no regressions to #43941 or #43851