Launcher: If downloading a resource fails, then cancel all subsequent pending resources

macOS: Fix on cocoa backend, total video memory and HW acceleration status wasn't being shown on /client gpu on macOS 10.4 and later
This commit is contained in:
UnknownShadow200 2023-09-07 20:56:47 +10:00
parent f9c898f859
commit aa2c0f4b9f
2 changed files with 11 additions and 5 deletions

View File

@ -1109,6 +1109,14 @@ static void Fetcher_Finish(void) {
}
}
static void Fetcher_Fail(struct HttpRequest* item) {
Http_ClearPending();
/* Only show error for first failed download */
if (!Fetcher_Failed) Fetcher_ErrorCallback(item);
Fetcher_Failed = true;
}
CC_NOINLINE static cc_bool Fetcher_Get(int reqID, struct HttpRequest* item) {
if (!Http_GetResult(reqID, item)) return false;
@ -1117,9 +1125,7 @@ CC_NOINLINE static cc_bool Fetcher_Get(int reqID, struct HttpRequest* item) {
return true;
}
/* Only show error for first failed download */
if (!Fetcher_Failed) Fetcher_ErrorCallback(item);
Fetcher_Failed = true;
Fetcher_Fail(item);
HttpRequest_Free(item);
Fetcher_Finish();

View File

@ -774,8 +774,8 @@ void GLContext_SetFpsLimit(cc_bool vsync, float minFrameMs) {
[ctxHandle setValues:&value forParameter: NSOpenGLCPSwapInterval];
}
/* kCGLCPCurrentRendererID is only defined on macOS 10.4 and later */
#ifdef kCGLCPCurrentRendererID
/* kCGLCPCurrentRendererID is only available on macOS 10.4 and later */
#if defined MAC_OS_X_VERSION_10_4
static const char* GetAccelerationMode(CGLContextObj ctx) {
GLint fGPU, vGPU;