| 1272 | } |
| 1273 | |
| 1274 | HashMap<GDScript *, RBSet<GDScript *>> GDScript::get_all_dependencies() { |
| 1275 | HashMap<GDScript *, RBSet<GDScript *>> all_dependencies; |
| 1276 | |
| 1277 | List<GDScript *> scripts; |
| 1278 | { |
| 1279 | MutexLock lock(GDScriptLanguage::singleton->mutex); |
| 1280 | |
| 1281 | SelfList<GDScript> *elem = GDScriptLanguage::singleton->script_list.first(); |
| 1282 | while (elem) { |
| 1283 | scripts.push_back(elem->self()); |
| 1284 | elem = elem->next(); |
| 1285 | } |
| 1286 | } |
| 1287 | |
| 1288 | for (GDScript *scr : scripts) { |
| 1289 | if (scr == nullptr || scr->destructing) { |
| 1290 | continue; |
| 1291 | } |
| 1292 | all_dependencies.insert(scr, scr->get_dependencies()); |
| 1293 | } |
| 1294 | |
| 1295 | return all_dependencies; |
| 1296 | } |
| 1297 | |
| 1298 | RBSet<GDScript *> GDScript::get_must_clear_dependencies() { |
| 1299 | RBSet<GDScript *> dependencies = get_dependencies(); |