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

Fix indexing failure in unregister_binding_functions. #28924

Merged
merged 1 commit into from
May 16, 2019
Merged

Fix indexing failure in unregister_binding_functions. #28924

merged 1 commit into from
May 16, 2019

Conversation

fsecilia
Copy link
Contributor

@fsecilia fsecilia commented May 15, 2019

binding_functions.size() and an instance's binding_data.size() can get out of sync. They sync up when an instance's bindings are requested. When binding functions are registered after creating an instance's bindings, the instance's bindings are out of sync until requested again. If they're never requested, they're never synced.

unregister_binding_functions indexes into binding_data, but only checks that its safe to index into binding_functions. When they're out of sync, indexing fails.

This revision checks that it's safe to index into binding_data.

Bugsquad edit: Fixes #28923

…tions.

binding_functions.size() and an instance's binding_data.size() can get out of sync. They sync up when an instance's bindings are requested. When binding functions are registered after creating an instance's bindings, the instance's bindings are out of sync until requested again. If they're never requested, they're never synced.

unregister_binding_functions indexes into binding_data, but only checks that its safe to index into binding_functions. When they're out of sync, indexing fails.

This revision checks that it's safe to index into binding_data.
@fsecilia fsecilia requested a review from karroffel as a code owner May 15, 2019 19:46
@fsecilia
Copy link
Contributor Author

Talking about "instance bindings" eventually sounds like doubletalk.

@akien-mga akien-mga added this to the 3.2 milestone May 16, 2019
@akien-mga akien-mga merged commit 978d71b into godotengine:master May 16, 2019
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NativeScriptLanguage::unregister_binding_functions fails.
4 participants