Fixed a crash when saving to network - this should be done from the video thread

This commit is contained in:
Sergii Pylypenko
2021-05-16 00:14:33 +03:00
parent 6c08881b4d
commit 2569a3f2ac
5 changed files with 53 additions and 33 deletions

View File

@@ -42,7 +42,6 @@ LoadCheckData _load_check_data; ///< Data loaded from save during SL_LOAD_CHE
static bool _fios_path_changed;
static bool _savegame_sort_dirty;
static const char *NETWORK_SAVE_FILENAME = "network-save.sav";
/**
@@ -731,19 +730,10 @@ public:
this->SetDirty();
break;
case WID_SL_LOAD_NETWORK_BUTTON: {
std::string savePath = FiosMakeSavegameName(NETWORK_SAVE_FILENAME);
#ifdef __ANDROID__
if (!SDL_ANDROID_CloudLoad(savePath.c_str(), NULL, "OpenTTD")) {
break;
}
#endif
_file_to_saveload.SetMode(FIOS_TYPE_FILE);
_file_to_saveload.SetName(savePath.c_str());
_file_to_saveload.SetTitle("Network Save");
_switch_mode = SM_LOAD_GAME;
break;
}
case WID_SL_LOAD_NETWORK_BUTTON:
_file_to_saveload.cloud_load = true;
delete this;
break;
}
}