You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
fixed a bug where saving a GDScript file crashed the editor
I changed the loop in #8502, turns out it fixed the error I was facing but introduced a new one. This fixes both
(cherry picked from commit 67886bab1e)
This commit is contained in:
committed by
Rémi Verschelde
parent
3d7756df8e
commit
e151b66127
@@ -1533,8 +1533,8 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
|
|||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
|
|
||||||
while (E->get()->placeholders.size()) {
|
while (E->get()->placeholders.size()) {
|
||||||
|
|
||||||
Object *obj = E->get()->placeholders.front()->get()->get_owner();
|
Object *obj = E->get()->placeholders.front()->get()->get_owner();
|
||||||
|
|
||||||
//save instance info
|
//save instance info
|
||||||
List<Pair<StringName, Variant> > state;
|
List<Pair<StringName, Variant> > state;
|
||||||
if (obj->get_script_instance()) {
|
if (obj->get_script_instance()) {
|
||||||
@@ -1542,6 +1542,9 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
|
|||||||
obj->get_script_instance()->get_property_state(state);
|
obj->get_script_instance()->get_property_state(state);
|
||||||
map[obj->get_instance_ID()] = state;
|
map[obj->get_instance_ID()] = state;
|
||||||
obj->set_script(RefPtr());
|
obj->set_script(RefPtr());
|
||||||
|
} else {
|
||||||
|
// no instance found. Let's remove it so we don't loop forever
|
||||||
|
E->get()->placeholders.erase(E->get()->placeholders.front()->get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user