mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 01:26:50 -04:00
Fix some browsers getting stuck in recursion loop and terminating the game when http request fails
This commit is contained in:
parent
511da3e542
commit
9e2bcba94d
@ -370,6 +370,13 @@ static void Http_FinishedAsync(emscripten_fetch_t* fetch) {
|
|||||||
req->statusCode = fetch->status;
|
req->statusCode = fetch->status;
|
||||||
req->contentLength = fetch->totalBytes;
|
req->contentLength = fetch->totalBytes;
|
||||||
|
|
||||||
|
/* Remove error handler to avoid potential infinite recurison */
|
||||||
|
/* Sometimes calling emscripten_fetch_close calls fetch->__attributes.onerror */
|
||||||
|
/* But attr.onerror is actually Http_FinishedAsync, so this will end up doing */
|
||||||
|
/* Http_FinishedAsync --> emscripten_fetch_close --> Http_FinishedAsync .. */
|
||||||
|
/* .. and eventually the browser kills it from too much recursion */
|
||||||
|
fetch->__attributes.onerror = NULL;
|
||||||
|
|
||||||
/* data needs to persist beyond closing of fetch data */
|
/* data needs to persist beyond closing of fetch data */
|
||||||
fetch->data = NULL;
|
fetch->data = NULL;
|
||||||
emscripten_fetch_close(fetch);
|
emscripten_fetch_close(fetch);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user