diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index ea54784f963..886d65d28cf 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -53,7 +53,7 @@ void GDScriptWorkspace::remove_cache_parser(const String &p_path) { Map::Element *parser = parse_results.find(p_path); Map::Element *script = scripts.find(p_path); if (parser && script) { - if (script->get() && script->get() == script->get()) { + if (script->get() && script->get() == parser->get()) { memdelete(script->get()); } else { memdelete(script->get());