diff options
author | geequlim <geequlim@gmail.com> | 2019-06-02 19:07:46 +0800 |
---|---|---|
committer | geequlim <geequlim@gmail.com> | 2019-06-02 19:57:33 +0800 |
commit | eed5967c0295c8c0ab214712e4882fcad6193905 (patch) | |
tree | cb604a5f0ac1bbb732f0cb5de4f85a5e59554ab6 /modules | |
parent | 449395716f8bacafc667ce1cd5cd8e35572db0b2 (diff) |
Fix GDSCript inner classes be freed after compile
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_compiler.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index f7be0ce37c..189317b163 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -1977,12 +1977,12 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar for (int i = 0; i < p_class->subclasses.size(); i++) { StringName name = p_class->subclasses[i]->name; - - GDScript *subclass = p_script->subclasses[name].ptr(); + Ref<GDScript> &subclass = p_script->subclasses[name]; + GDScript *subclass_ptr = subclass.ptr(); // Subclass might still be parsing, just skip it - if (!parsed_classes.has(subclass) && !parsing_classes.has(subclass)) { - Error err = _parse_class_level(subclass, p_class->subclasses[i], p_keep_state); + if (!parsed_classes.has(subclass_ptr) && !parsing_classes.has(subclass_ptr)) { + Error err = _parse_class_level(subclass_ptr, p_class->subclasses[i], p_keep_state); if (err) return err; } |