mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
(svn r22070) -Fix [FS#4503] (r21399): crashes when disconnecting after requesting the map
This commit is contained in:
parent
a19bc28aba
commit
befa79ba4a
@ -181,8 +181,12 @@ ServerNetworkGameSocketHandler::~ServerNetworkGameSocketHandler()
|
|||||||
if (this->savegame != NULL) this->savegame->cs = NULL;
|
if (this->savegame != NULL) this->savegame->cs = NULL;
|
||||||
if (this->savegame_mutex != NULL) this->savegame_mutex->EndCritical();
|
if (this->savegame_mutex != NULL) this->savegame_mutex->EndCritical();
|
||||||
|
|
||||||
/* Make sure the saving is completely cancelled. */
|
/* Make sure the saving is completely cancelled.
|
||||||
if (this->savegame != NULL) WaitTillSaved();
|
* Yes, we need to handle the save finish as well
|
||||||
|
* as the next connection in this "loop" might
|
||||||
|
* just be requesting the map and such. */
|
||||||
|
WaitTillSaved();
|
||||||
|
ProcessAsyncSaveFinish();
|
||||||
|
|
||||||
while (this->savegame_packets != NULL) {
|
while (this->savegame_packets != NULL) {
|
||||||
Packet *p = this->savegame_packets->next;
|
Packet *p = this->savegame_packets->next;
|
||||||
|
@ -75,7 +75,6 @@ void IncreaseDate();
|
|||||||
void DoPaletteAnimations();
|
void DoPaletteAnimations();
|
||||||
void MusicLoop();
|
void MusicLoop();
|
||||||
void ResetMusic();
|
void ResetMusic();
|
||||||
void ProcessAsyncSaveFinish();
|
|
||||||
void CallWindowTickEvent();
|
void CallWindowTickEvent();
|
||||||
|
|
||||||
extern void SetDifficultyLevel(int mode, DifficultySettings *gm_opt);
|
extern void SetDifficultyLevel(int mode, DifficultySettings *gm_opt);
|
||||||
|
@ -54,6 +54,7 @@ void SetSaveLoadError(uint16 str);
|
|||||||
const char *GetSaveLoadErrorString();
|
const char *GetSaveLoadErrorString();
|
||||||
SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, bool threaded = true);
|
SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, bool threaded = true);
|
||||||
void WaitTillSaved();
|
void WaitTillSaved();
|
||||||
|
void ProcessAsyncSaveFinish();
|
||||||
void DoExitSave();
|
void DoExitSave();
|
||||||
|
|
||||||
SaveOrLoadResult SaveWithFilter(struct SaveFilter *writer, bool threaded);
|
SaveOrLoadResult SaveWithFilter(struct SaveFilter *writer, bool threaded);
|
||||||
|
Loading…
Reference in New Issue
Block a user