diff options
| author | Thomas Herzog | 2018-01-06 22:22:11 +0100 |
|---|---|---|
| committer | GitHub | 2018-01-06 22:22:11 +0100 |
| commit | 59f92e46b9271ed6c5e45f00961fb6066df8339a (patch) | |
| tree | 06c8eb2d9761752e7f7d2d0ecc49b357662d9e19 /modules/gdnative/nativescript/nativescript.cpp | |
| parent | d72a32bc54cda565aabfa5549c0cec7c29697950 (diff) | |
| parent | 66eed7b85985529e54449cf87feee001cba0c759 (diff) | |
| download | godot-59f92e46b9271ed6c5e45f00961fb6066df8339a.tar.gz godot-59f92e46b9271ed6c5e45f00961fb6066df8339a.tar.zst godot-59f92e46b9271ed6c5e45f00961fb6066df8339a.zip | |
Merge pull request #15414 from karroffel/gdnative-reloading-properly-this-time
[GDNative] fix reloading of non-reloadable libraries
Diffstat (limited to 'modules/gdnative/nativescript/nativescript.cpp')
| -rw-r--r-- | modules/gdnative/nativescript/nativescript.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 2d94599ea..e9e318083 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -790,8 +790,13 @@ NativeScriptInstance::~NativeScriptInstance() { NativeScriptLanguage *NativeScriptLanguage::singleton; -void NativeScriptLanguage::_unload_stuff() { +void NativeScriptLanguage::_unload_stuff(bool p_reload) { for (Map<String, Map<StringName, NativeScriptDesc> >::Element *L = library_classes.front(); L; L = L->next()) { + + if (p_reload && !library_gdnatives[L->key()]->get_library()->is_reloadable()) { + continue; + } + for (Map<StringName, NativeScriptDesc>::Element *C = L->get().front(); C; C = C->next()) { // free property stuff first @@ -1108,7 +1113,7 @@ void NativeReloadNode::_notification(int p_what) { #ifndef NO_THREADS MutexLock lock(NSL->mutex); #endif - NSL->_unload_stuff(); + NSL->_unload_stuff(true); for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { Ref<GDNative> gdn = L->get(); |
