You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godot version:
3.1-stable, but probably since 0b2afa2.
OS/device including version:
Arch Linux
Issue description: NativeScriptLanguage::unregister_binding_functions() fails when binding_data.size() gets out of sync with binding_functions.size().
This happens when a gdnative library creates instance bindings for an instance of a global type, then more gdnative libraries are loaded but do not refer to that instance. Each loaded library increases the size of binding_functions, but an instance's binding_data is only updated when looking up that instance's instance bindings.
Steps to reproduce:
Consider this case. A gdnative library is loaded. It registers instance binding functions. binding_functions.size() is now 1. That library then looks up instance bindings for ResourceLoader. This creates instance bindings on ResourceLoader for that library's language. ResourceLoader's binding_data.size() is now 1.
Later, another library is loaded. This library also registers instance binding functions, so binding_functions.size() is now 2. Nothing refers to ResourceLoader's instance bindings, so its binding_data.size() is still 1.
When NativeScriptLanguage::unregister_binding_functions is called, binding_functions.size() is still 2, but ResourceLoader's binding_data.size() is still 1, causing binding_data[p_idx] to fail.
Minimal reproduction project:
This isn't trivial to reproduce, but I have a patch ready.
The text was updated successfully, but these errors were encountered:
Godot version:
3.1-stable, but probably since 0b2afa2.
OS/device including version:
Arch Linux
Issue description:
NativeScriptLanguage::unregister_binding_functions()
fails whenbinding_data.size()
gets out of sync withbinding_functions.size()
.This happens when a gdnative library creates instance bindings for an instance of a global type, then more gdnative libraries are loaded but do not refer to that instance. Each loaded library increases the size of
binding_functions
, but an instance'sbinding_data
is only updated when looking up that instance's instance bindings.Steps to reproduce:
Consider this case. A gdnative library is loaded. It registers instance binding functions.
binding_functions.size()
is now 1. That library then looks up instance bindings forResourceLoader
. This creates instance bindings onResourceLoader
for that library's language.ResourceLoader
'sbinding_data.size()
is now 1.Later, another library is loaded. This library also registers instance binding functions, so
binding_functions.size()
is now 2. Nothing refers toResourceLoader
's instance bindings, so itsbinding_data.size()
is still 1.When
NativeScriptLanguage::unregister_binding_functions
is called,binding_functions.size()
is still 2, butResourceLoader
'sbinding_data.size()
is still 1, causingbinding_data[p_idx]
to fail.Minimal reproduction project:
This isn't trivial to reproduce, but I have a patch ready.
The text was updated successfully, but these errors were encountered: