| 175 | } |
| 176 | |
| 177 | bool GDScriptFunctionState::is_valid(bool p_extended_check) const { |
| 178 | if (function == nullptr) { |
| 179 | return false; |
| 180 | } |
| 181 | |
| 182 | if (p_extended_check) { |
| 183 | MutexLock lock(GDScriptLanguage::get_singleton()->mutex); |
| 184 | |
| 185 | // Script gone? |
| 186 | if (!scripts_list.in_list()) { |
| 187 | return false; |
| 188 | } |
| 189 | // Class instance gone? (if not static function) |
| 190 | if (state.instance && !instances_list.in_list()) { |
| 191 | return false; |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | return true; |
| 196 | } |
| 197 | |
| 198 | Variant GDScriptFunctionState::resume(const Variant &p_arg) { |
| 199 | ERR_FAIL_NULL_V(function, Variant()); |