| 1531 | } |
| 1532 | |
| 1533 | void GDScript::_recurse_replace_function_ptrs(const HashMap<GDScriptFunction *, GDScriptFunction *> &p_replacements) const { |
| 1534 | MutexLock lock(func_ptrs_to_update_mutex); |
| 1535 | for (UpdatableFuncPtr *updatable : func_ptrs_to_update) { |
| 1536 | HashMap<GDScriptFunction *, GDScriptFunction *>::ConstIterator replacement = p_replacements.find(updatable->ptr); |
| 1537 | if (replacement) { |
| 1538 | updatable->ptr = replacement->value; |
| 1539 | } else { |
| 1540 | // Probably a lambda from another reload, ignore. |
| 1541 | updatable->ptr = nullptr; |
| 1542 | } |
| 1543 | } |
| 1544 | |
| 1545 | for (HashMap<StringName, Ref<GDScript>>::ConstIterator subscript = subclasses.begin(); subscript; ++subscript) { |
| 1546 | subscript->value->_recurse_replace_function_ptrs(p_replacements); |
| 1547 | } |
| 1548 | } |
| 1549 | |
| 1550 | void GDScript::clear(ClearData *p_clear_data) { |
| 1551 | if (clearing) { |