summaryrefslogtreecommitdiffstats
path: root/modules/nativescript/nativescript.cpp
diff options
context:
space:
mode:
authorThomas Herzog <thomas.herzog@mail.com>2017-08-04 16:59:06 +0200
committerGitHub <noreply@github.com>2017-08-04 16:59:06 +0200
commitf79a5c464b95bdd274a4e9e5ff4713c7de2be011 (patch)
tree2de6933fe884096861ba7c86463639422b1b45c8 /modules/nativescript/nativescript.cpp
parent7ac50b523b8cb313245e2fbdd16b5561c88b3aeb (diff)
parentd71171026f321b635b93e1c4e026f791ff51d324 (diff)
downloadredot-engine-f79a5c464b95bdd274a4e9e5ff4713c7de2be011.tar.gz
Merge pull request #10085 from endragor/no-uninitialized-cb
Dont call nativescript callbacks if lib is not initialized
Diffstat (limited to 'modules/nativescript/nativescript.cpp')
-rw-r--r--modules/nativescript/nativescript.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/nativescript/nativescript.cpp b/modules/nativescript/nativescript.cpp
index 226b5effa9..fb334e573c 100644
--- a/modules/nativescript/nativescript.cpp
+++ b/modules/nativescript/nativescript.cpp
@@ -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);
+ }
}
}