diff --git a/src/Resources.c b/src/Resources.c index b6945b54f..b9c5a4019 100644 --- a/src/Resources.c +++ b/src/Resources.c @@ -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(); diff --git a/src/interop_cocoa.m b/src/interop_cocoa.m index 437dd06b2..9cc2b094f 100644 --- a/src/interop_cocoa.m +++ b/src/interop_cocoa.m @@ -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;