-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Fix double unregistration on dispose of Array. #81230
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
I just realized my initial pull request description was nonsense. There is no recursion going on and we can skip the temporary variable. |
Based on the investigation in the bug, update the PR to instead avoid double registration that seems to be the root cause of the issue. |
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.
Thanks! I read the explanation in #81231 (comment) and I understand what's going on now, I've been able to reproduce the issue and this looks like the correct fix.
It seems we can also remove : this()
from the Array<T>
constructor that takes T[] array
. Although I don't think this one causes any issues, but we can save allocating Array
twice:
Also, since you are a new contributor, make sure to read CONTRIBUTING.md and the contributing documentation if you haven't already.
You'll need to squash the commits before this PR can be merged. The contributing documentation contains information about squashing in case you need it.
Feel free to reach out in the development chat if you need help.
5b2972b
to
c0b5309
Compare
I've squashed the commits as well as removed the one extra "this()" call from the generic version of the Array class. |
This fixes a bug where Array would get registered twice with the DisposablesTracker causing an exception on shutdown. Fixes godotengine#81231
c0b5309
to
43a6748
Compare
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.
LGTM.
Thanks! |
Cherry-picked for 4.1.2. |
This fixes a small bug where Array tries to unregister itself twice on shutdown.
I have tested this manually and the error is no longer logged on shutdown.