summaryrefslogtreecommitdiff
path: root/modules/gdnative
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-04-10 08:53:49 +0200
committerGitHub <noreply@github.com>2017-04-10 08:53:49 +0200
commit5598040e43e7074cec4f04b36b0fd6400c79f69c (patch)
tree83ee3f8eb52893e09a41a04b4e769ffab3bb3e12 /modules/gdnative
parent8764659234bb2303cf67d7c3ab169946ddd9d277 (diff)
parent0486645c39c471e8844520b70c25956a7a2f40c5 (diff)
Merge pull request #8339 from karroffel/gdnative-reload-fix
[GDNative] Didn't iterate over all scripts
Diffstat (limited to 'modules/gdnative')
-rw-r--r--modules/gdnative/gdnative.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index 43b309ae36..f646060d49 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -1167,27 +1167,25 @@ void GDNativeReloadNode::_notification(int p_what) {
// update placeholders (if any)
- GDNativeScript *script = NULL;
+ Set<GDNativeScript *> scripts;
for (Set<GDNativeScript *>::Element *S = GDNativeScriptLanguage::get_singleton()->script_list.front(); S; S = S->next()) {
if (lib->native_library->scripts.has(S->get()->get_script_name())) {
- script = S->get();
+ GDNativeScript *script = S->get();
script->script_data = lib->get_script_data(script->get_script_name());
- break;
+ scripts.insert(script);
}
}
- if (script == NULL) {
- // new class, cool. Nothing to do here
- continue;
- }
-
- if (script->placeholders.size() == 0)
- continue;
+ for (Set<GDNativeScript *>::Element *S = scripts.front(); S; S = S->next()) {
+ GDNativeScript *script = S->get();
+ if (script->placeholders.size() == 0)
+ continue;
- for (Set<PlaceHolderScriptInstance *>::Element *P = script->placeholders.front(); P; P = P->next()) {
- PlaceHolderScriptInstance *p = P->get();
- script->_update_placeholder(p);
+ for (Set<PlaceHolderScriptInstance *>::Element *P = script->placeholders.front(); P; P = P->next()) {
+ PlaceHolderScriptInstance *p = P->get();
+ script->_update_placeholder(p);
+ }
}
}