src/video/cocoa/SDL_cocoashape.m
changeset 6832 156e608ec4ef
parent 6281 e46d6f4b469e
child 6848 478ecc8a58b3
     1.1 --- a/src/video/cocoa/SDL_cocoashape.m	Fri Feb 01 17:09:01 2013 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoashape.m	Sun Jan 06 19:04:53 2013 +0300
     1.3 @@ -74,7 +74,7 @@
     1.4      SDL_ShapeData* data = (SDL_ShapeData*)shaper->driverdata;
     1.5  	SDL_WindowData* windata = (SDL_WindowData*)shaper->window->driverdata;
     1.6  	SDL_CocoaClosure closure;
     1.7 -	NSAutoreleasePool *pool = NULL;
     1.8 +
     1.9      if(data->saved == SDL_TRUE) {
    1.10          [data->context restoreGraphicsState];
    1.11          data->saved = SDL_FALSE;
    1.12 @@ -88,12 +88,13 @@
    1.13      NSRectFill([[windata->nswindow contentView] frame]);
    1.14      data->shape = SDL_CalculateShapeTree(*shape_mode,shape);
    1.15  	
    1.16 -	pool = [[NSAutoreleasePool alloc] init];
    1.17 -    closure.view = [windata->nswindow contentView];
    1.18 -    closure.path = [[NSBezierPath bezierPath] autorelease];
    1.19 -	closure.window = shaper->window;
    1.20 -    SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure);
    1.21 -    [closure.path addClip];
    1.22 +    @autoreleasepool {
    1.23 +        closure.view = [windata->nswindow contentView];
    1.24 +        closure.path = [[NSBezierPath bezierPath] autorelease];
    1.25 +        closure.window = shaper->window;
    1.26 +        SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure);
    1.27 +        [closure.path addClip];
    1.28 +    }
    1.29  
    1.30      return 0;
    1.31  }