mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-25 17:18:49 -07:00
FIX: gui: fix the crash issue on arm64 plateform
jira: no-jira Change-Id: Ib95ffc3ceb421af345418d73af0261d3c25464a3 (cherry picked from commit 132d87b687f4b3bd016539380d7e9268d817ac40)
This commit is contained in:
parent
c0ba405a64
commit
aec877c7e0
1 changed files with 22 additions and 0 deletions
|
|
@ -1225,6 +1225,17 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install
|
|||
fs::path tmp_path = target_file_path;
|
||||
tmp_path += format(".%1%%2%", get_current_pid(), ".tmp");
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
if (is_running_on_arm64()) {
|
||||
//set to arm64 for plugins
|
||||
std::map<std::string, std::string> current_headers = Slic3r::Http::get_extra_headers();
|
||||
current_headers["X-BBL-OS-Type"] = "windows_arm";
|
||||
|
||||
Slic3r::Http::set_extra_headers(current_headers);
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("download_plugin: set X-BBL-OS-Type to windows_arm");
|
||||
}
|
||||
#endif
|
||||
|
||||
// get_url
|
||||
std::string url = get_plugin_url(name, app_config->get_country_code());
|
||||
std::string download_url;
|
||||
|
|
@ -1282,6 +1293,17 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install
|
|||
result = -1;
|
||||
}).perform_sync();
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
if (is_running_on_arm64()) {
|
||||
//set back
|
||||
std::map<std::string, std::string> current_headers = Slic3r::Http::get_extra_headers();
|
||||
current_headers["X-BBL-OS-Type"] = "windows";
|
||||
|
||||
Slic3r::Http::set_extra_headers(current_headers);
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("download_plugin: set X-BBL-OS-Type back to windows");
|
||||
}
|
||||
#endif
|
||||
|
||||
bool cancel = false;
|
||||
if (result < 0) {
|
||||
j["result"] = "failed";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue