src/video/cocoa/SDL_cocoawindow.m
changeset 1937 05e88d266921
parent 1936 83946ee0ff1f
child 1951 7177581dc9fa
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Tue Jul 25 06:22:42 2006 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Tue Jul 25 06:59:14 2006 +0000
     1.3 @@ -419,6 +419,7 @@
     1.4  void
     1.5  Cocoa_SetWindowTitle(_THIS, SDL_Window * window)
     1.6  {
     1.7 +    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     1.8      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window;
     1.9      NSString *string;
    1.10  
    1.11 @@ -426,11 +427,13 @@
    1.12      [nswindow setTitle:string];
    1.13      [nswindow setMiniwindowTitle:string];
    1.14      [string release];
    1.15 +    [pool release];
    1.16  }
    1.17  
    1.18  void
    1.19  Cocoa_SetWindowPosition(_THIS, SDL_Window * window)
    1.20  {
    1.21 +    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.22      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window;
    1.23      NSRect rect;
    1.24  
    1.25 @@ -441,25 +444,30 @@
    1.26      ConvertNSRect(&rect);
    1.27      rect = [nswindow frameRectForContentRect:rect];
    1.28      [nswindow setFrameOrigin:rect.origin];
    1.29 +    [pool release];
    1.30  }
    1.31  
    1.32  void
    1.33  Cocoa_SetWindowSize(_THIS, SDL_Window * window)
    1.34  {
    1.35 +    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.36      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window;
    1.37      NSSize size;
    1.38  
    1.39      size.width = window->w;
    1.40      size.height = window->h;
    1.41      [nswindow setContentSize:size];
    1.42 +    [pool release];
    1.43  }
    1.44  
    1.45  void
    1.46  Cocoa_ShowWindow(_THIS, SDL_Window * window)
    1.47  {
    1.48 +    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.49      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window;
    1.50  
    1.51      [nswindow makeKeyAndOrderFront:nil];
    1.52 +    [pool release];
    1.53  }
    1.54  
    1.55  void
    1.56 @@ -473,25 +481,31 @@
    1.57  void
    1.58  Cocoa_RaiseWindow(_THIS, SDL_Window * window)
    1.59  {
    1.60 +    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.61      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window;
    1.62  
    1.63      [nswindow makeKeyAndOrderFront:nil];
    1.64 +    [pool release];
    1.65  }
    1.66  
    1.67  void
    1.68  Cocoa_MaximizeWindow(_THIS, SDL_Window * window)
    1.69  {
    1.70 +    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.71      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window;
    1.72  
    1.73      [nswindow performZoom:nil];
    1.74 +    [pool release];
    1.75  }
    1.76  
    1.77  void
    1.78  Cocoa_MinimizeWindow(_THIS, SDL_Window * window)
    1.79  {
    1.80 +    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.81      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->window;
    1.82  
    1.83      [nswindow performMiniaturize:nil];
    1.84 +    [pool release];
    1.85  }
    1.86  
    1.87  void
    1.88 @@ -516,24 +530,23 @@
    1.89  void
    1.90  Cocoa_DestroyWindow(_THIS, SDL_Window * window)
    1.91  {
    1.92 +    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.93      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    1.94  
    1.95      if (data) {
    1.96 -        NSAutoreleasePool *pool;
    1.97  #ifdef SDL_VIDEO_OPENGL
    1.98          if (window->flags & SDL_WINDOW_OPENGL) {
    1.99              Cocoa_GL_CleanupWindow(_this, window);
   1.100          }
   1.101  #endif
   1.102 -        pool = [[NSAutoreleasePool alloc] init];
   1.103          [data->listener close];
   1.104          [data->listener release];
   1.105          if (data->created) {
   1.106              [data->window close];
   1.107          }
   1.108          SDL_free(data);
   1.109 -        [pool release];
   1.110      }
   1.111 +    [pool release];
   1.112  }
   1.113  
   1.114  SDL_bool