Closed a memory leak caused when quitting video subsystem on Quartz target.
authorRyan C. Gordon
Thu, 13 Oct 2005 09:47:06 +0000
changeset 116072c6c3e5bb85
parent 1159 787b8d2c23e4
child 1161 05d4b93b911e
Closed a memory leak caused when quitting video subsystem on Quartz target.
src/video/quartz/SDL_QuartzGL.m
src/video/quartz/SDL_QuartzVideo.m
     1.1 --- a/src/video/quartz/SDL_QuartzGL.m	Tue Oct 11 23:57:04 2005 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzGL.m	Thu Oct 13 09:47:06 2005 +0000
     1.3 @@ -119,6 +119,8 @@
     1.4      gl_context = [ [ NSOpenGLContext alloc ] initWithFormat:fmt
     1.5                                                 shareContext:nil];
     1.6  
     1.7 +    [ fmt release ];
     1.8 +
     1.9      if (gl_context == nil) {
    1.10          SDL_SetError ("Failed creating OpenGL context");
    1.11          return 0;
    1.12 @@ -152,8 +154,6 @@
    1.13      /* Convince SDL that the GL "driver" is loaded */
    1.14      this->gl_config.driver_loaded = 1;
    1.15  
    1.16 -    [ fmt release ];
    1.17 -
    1.18      return 1;
    1.19  }
    1.20  
     2.1 --- a/src/video/quartz/SDL_QuartzVideo.m	Tue Oct 11 23:57:04 2005 +0000
     2.2 +++ b/src/video/quartz/SDL_QuartzVideo.m	Thu Oct 13 09:47:06 2005 +0000
     2.3 @@ -487,9 +487,10 @@
     2.4      else {
     2.5          
     2.6          [ qz_window close ];
     2.7 +        [ qz_window release ];
     2.8          qz_window = nil;
     2.9          window_view = nil;
    2.10 -        
    2.11 +
    2.12          /* Release the OpenGL context */
    2.13          if ( mode_flags & SDL_OPENGL )
    2.14              QZ_TearDownOpenGL (this);