mirror of
https://github.com/godotengine/godot.git
synced 2025-11-02 22:51:08 +00:00
Dont call nativescript callbacks if lib is not initialized
This commit is contained in:
parent
7ac50b523b
commit
d71171026f
3 changed files with 17 additions and 10 deletions
|
|
@ -1055,13 +1055,15 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) {
|
|||
void NativeScriptLanguage::call_libraries_cb(const StringName &name) {
|
||||
// library_gdnatives is modified only from the main thread, so it's safe not to use mutex here
|
||||
for (Map<String, Ref<GDNative> >::Element *L = library_gdnatives.front(); L; L = L->next()) {
|
||||
L->get()->call_native_raw(
|
||||
_noarg_call_type,
|
||||
name,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
if (L->get()->is_initialized()) {
|
||||
L->get()->call_native_raw(
|
||||
_noarg_call_type,
|
||||
name,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue