From a452a08458c5274aa37faad25344c2e572de9637 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 1 Jan 2018 19:40:29 -0400 Subject: [PATCH] iOS: fix build --- src/render/metal/SDL_render_metal.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 6ea6ede7a..814ad599f 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -424,7 +424,7 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags) data.mtlpipelineprims = MakePipelineCache(data, "SDL primitives pipeline ", SDL_METAL_VERTEX_SOLID, SDL_METAL_FRAGMENT_SOLID); data.mtlpipelinecopy = MakePipelineCache(data, "SDL texture pipeline ", SDL_METAL_VERTEX_COPY, SDL_METAL_FRAGMENT_COPY); - MTLSamplerDescriptor *samplerdesc = [[[MTLSamplerDescriptor alloc] init] autorelease]; + MTLSamplerDescriptor *samplerdesc = [[MTLSamplerDescriptor alloc] init]; samplerdesc.minFilter = MTLSamplerMinMagFilterNearest; samplerdesc.magFilter = MTLSamplerMinMagFilterNearest; @@ -434,6 +434,10 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags) samplerdesc.magFilter = MTLSamplerMinMagFilterLinear; data.mtlsamplerlinear = [data.mtldevice newSamplerStateWithDescriptor:samplerdesc]; +#if !__has_feature(objc_arc) + [samplerdesc release]; +#endif + static const float clearverts[] = { 0, 0, 0, 3, 3, 0 }; data.mtlbufclearverts = [data.mtldevice newBufferWithBytes:clearverts length:sizeof(clearverts) options:MTLResourceCPUCacheModeWriteCombined]; data.mtlbufclearverts.label = @"SDL_RenderClear vertices";