Skip to content

Commit

Permalink
Merge pull request #30820 from neikeq/issue-28394
Browse files Browse the repository at this point in the history
Mono: Don't try to update project assemblies from project manager
  • Loading branch information
neikeq authored Jul 25, 2019
2 parents eb16c98 + c9befa6 commit 3a68b24
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions modules/mono/mono_gd/gd_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,14 @@ bool GDMono::_load_core_api_assembly() {

#ifdef TOOLS_ENABLED
// For the editor and the editor player we want to load it from a specific path to make sure we can keep it up to date
String assembly_path = GodotSharpDirs::get_res_assemblies_dir().plus_file(CORE_API_ASSEMBLY_NAME ".dll");

// If running the project manager, load it from the prebuilt API directory
String assembly_dir = !Main::is_project_manager() ?
GodotSharpDirs::get_res_assemblies_dir() :
GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file("Debug");

String assembly_path = assembly_dir.plus_file(CORE_API_ASSEMBLY_NAME ".dll");

bool success = FileAccess::exists(assembly_path) &&
load_assembly_from(CORE_API_ASSEMBLY_NAME, assembly_path, &core_api_assembly);
#else
Expand Down Expand Up @@ -688,7 +695,14 @@ bool GDMono::_load_editor_api_assembly() {
return true;

// For the editor and the editor player we want to load it from a specific path to make sure we can keep it up to date
String assembly_path = GodotSharpDirs::get_res_assemblies_dir().plus_file(EDITOR_API_ASSEMBLY_NAME ".dll");

// If running the project manager, load it from the prebuilt API directory
String assembly_dir = !Main::is_project_manager() ?
GodotSharpDirs::get_res_assemblies_dir() :
GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file("Debug");

String assembly_path = assembly_dir.plus_file(EDITOR_API_ASSEMBLY_NAME ".dll");

bool success = FileAccess::exists(assembly_path) &&
load_assembly_from(EDITOR_API_ASSEMBLY_NAME, assembly_path, &editor_api_assembly);

Expand Down Expand Up @@ -740,6 +754,12 @@ void GDMono::_load_api_assemblies() {
// The API assemblies are out of sync. Fine, try one more time, but this time
// update them from the prebuilt assemblies directory before trying to load them.

// Shouldn't happen. The project manager loads the prebuilt API assemblies
if (Main::is_project_manager()) {
ERR_EXPLAIN("Failed to load one of the prebuilt API assemblies");
CRASH_NOW();
}

// 1. Unload the scripts domain
if (_unload_scripts_domain() != OK) {
ERR_EXPLAIN("Mono: Failed to unload scripts domain");
Expand Down

0 comments on commit 3a68b24

Please sign in to comment.