From d71171026f321b635b93e1c4e026f791ff51d324 Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Fri, 4 Aug 2017 21:17:33 +0700 Subject: Dont call nativescript callbacks if lib is not initialized --- modules/nativescript/nativescript.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'modules/nativescript/nativescript.cpp') 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 >::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); + } } } -- cgit v1.2.3