mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 23:46:59 +00:00
fix crash when cancelling download
This commit is contained in:
parent
007cd6573e
commit
1260515a40
@ -214,6 +214,8 @@ std::vector<char> MultiDownload(SOCKET MSock, SOCKET DSock, uint64_t Size, const
|
|||||||
|
|
||||||
if (MData.empty()) {
|
if (MData.empty()) {
|
||||||
MultiKill(MSock, DSock);
|
MultiKill(MSock, DSock);
|
||||||
|
Terminate = true;
|
||||||
|
Au.join();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,6 +223,8 @@ std::vector<char> MultiDownload(SOCKET MSock, SOCKET DSock, uint64_t Size, const
|
|||||||
|
|
||||||
if (DData.empty()) {
|
if (DData.empty()) {
|
||||||
MultiKill(MSock, DSock);
|
MultiKill(MSock, DSock);
|
||||||
|
Terminate = true;
|
||||||
|
Au.join();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,6 +232,8 @@ std::vector<char> MultiDownload(SOCKET MSock, SOCKET DSock, uint64_t Size, const
|
|||||||
GRcv = MData.size() + DData.size();
|
GRcv = MData.size() + DData.size();
|
||||||
if (GRcv != Size) {
|
if (GRcv != Size) {
|
||||||
error("Something went wrong during download; didn't get enough data. Expected " + std::to_string(Size) + " bytes, got " + std::to_string(GRcv) + " bytes instead");
|
error("Something went wrong during download; didn't get enough data. Expected " + std::to_string(Size) + " bytes, got " + std::to_string(GRcv) + " bytes instead");
|
||||||
|
Terminate = true;
|
||||||
|
Au.join();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user