Mono/C#: Fix assemblies being reloaded a second time unnecesarily

(cherry picked from commit c9882e61e2)
This commit is contained in:
Ignacio Etcheverry 2020-04-23 02:23:25 +02:00 committed by Rémi Verschelde
parent cf729f2111
commit dfdb7bdc87
1 changed files with 4 additions and 1 deletions

View File

@ -1386,6 +1386,9 @@ bool _GodotSharp::is_runtime_initialized() {
void _GodotSharp::_reload_assemblies(bool p_soft_reload) { void _GodotSharp::_reload_assemblies(bool p_soft_reload) {
#ifdef GD_MONO_HOT_RELOAD #ifdef GD_MONO_HOT_RELOAD
// This method may be called more than once with `call_deferred`, so we need to check
// again if reloading is needed to avoid reloading multiple times unnecessarily.
if (CSharpLanguage::get_singleton()->is_assembly_reloading_needed())
CSharpLanguage::get_singleton()->reload_assemblies(p_soft_reload); CSharpLanguage::get_singleton()->reload_assemblies(p_soft_reload);
#endif #endif
} }