MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / remove_script

Method remove_script

modules/gdscript/gdscript_cache.cpp:187–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void GDScriptCache::remove_script(const String &p_path) {
188 if (singleton == nullptr) {
189 return;
190 }
191
192 MutexLock lock(singleton->mutex);
193
194 if (singleton->cleared) {
195 return;
196 }
197
198 if (HashMap<String, Vector<ObjectID>>::Iterator E = singleton->abandoned_parser_map.find(p_path)) {
199 for (ObjectID parser_ref_id : E->value) {
200 Ref<GDScriptParserRef> parser_ref = { ObjectDB::get_instance(parser_ref_id) };
201 if (parser_ref.is_valid()) {
202 parser_ref->clear();
203 }
204 }
205 }
206
207 singleton->abandoned_parser_map.erase(p_path);
208
209 if (singleton->parser_map.has(p_path)) {
210 singleton->parser_map[p_path]->clear();
211 }
212
213 remove_parser(p_path);
214
215 singleton->dependencies.erase(p_path);
216 singleton->shallow_gdscript_cache.erase(p_path);
217 singleton->full_gdscript_cache.erase(p_path);
218}
219
220Ref<GDScriptParserRef> GDScriptCache::get_parser(const String &p_path, GDScriptParserRef::Status p_status, Error &r_error, const String &p_owner) {
221 MutexLock lock(singleton->mutex);

Callers

nothing calls this directly

Calls 5

findMethod · 0.45
is_validMethod · 0.45
clearMethod · 0.45
eraseMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected