You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Keep GDScriptAnalyzer alive for whole parse()
Analyzed data is allocated by Parser but kept as a reference in the cache which in turn is held by the Analyzer. If Analyzer goes away Parser is left with a tree of dangling references. Code is analogous to all other usages of Analyzer + Parser pair.
This commit is contained in:
@@ -844,8 +844,9 @@ Error ExtendGDScriptParser::parse(const String &p_code, const String &p_path) {
|
|||||||
lines = p_code.split("\n");
|
lines = p_code.split("\n");
|
||||||
|
|
||||||
Error err = GDScriptParser::parse(p_code, p_path, false);
|
Error err = GDScriptParser::parse(p_code, p_path, false);
|
||||||
|
GDScriptAnalyzer analyzer(this);
|
||||||
|
|
||||||
if (err == OK) {
|
if (err == OK) {
|
||||||
GDScriptAnalyzer analyzer(this);
|
|
||||||
err = analyzer.analyze();
|
err = analyzer.analyze();
|
||||||
}
|
}
|
||||||
update_diagnostics();
|
update_diagnostics();
|
||||||
|
|||||||
Reference in New Issue
Block a user