diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-04-26 01:19:54 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-04-26 19:53:44 +0200 |
commit | 791e1294c33626adad323f292702221cc09c21cc (patch) | |
tree | e344d2e46f30ea1acc0751c3d9a82db7e1e124f6 /modules/mono/csharp_script.cpp | |
parent | bf1fe11143241446dc0d8b841f46ac5b9ff4e574 (diff) | |
download | redot-engine-791e1294c33626adad323f292702221cc09c21cc.tar.gz |
Mono: Lazily load scripts metadata file
- Only load the scripts metadata file when it's really needed. This way we avoid false errors, when there is no C# project, about missing scripts metadata file.
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r-- | modules/mono/csharp_script.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 3c9644127c..31d6421a4c 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -919,7 +919,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { } #endif -void CSharpLanguage::project_assembly_loaded() { +void CSharpLanguage::_load_scripts_metadata() { scripts_metadata.clear(); @@ -953,6 +953,7 @@ void CSharpLanguage::project_assembly_loaded() { } scripts_metadata = old_dict_var.operator Dictionary(); + scripts_metadata_invalidated = false; print_verbose("Successfully loaded scripts metadata"); } else { @@ -1024,11 +1025,13 @@ bool CSharpLanguage::debug_break(const String &p_error, bool p_allow_continue) { } } -void CSharpLanguage::_uninitialize_script_bindings() { +void CSharpLanguage::_on_scripts_domain_unloaded() { for (Map<Object *, CSharpScriptBinding>::Element *E = script_bindings.front(); E; E = E->next()) { CSharpScriptBinding &script_binding = E->value(); script_binding.inited = false; } + + scripts_metadata_invalidated = true; } void CSharpLanguage::set_language_index(int p_idx) { @@ -1086,6 +1089,8 @@ CSharpLanguage::CSharpLanguage() { #endif lang_idx = -1; + + scripts_metadata_invalidated = true; } CSharpLanguage::~CSharpLanguage() { |