Skip to content

Commit

Permalink
Closed a memory leak caused when quitting video subsystem on Quartz t…
Browse files Browse the repository at this point in the history
…arget.
  • Loading branch information
icculus committed Oct 13, 2005
1 parent fd2f2a8 commit 27a1382
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/video/quartz/SDL_QuartzGL.m
Expand Up @@ -119,6 +119,8 @@ int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags) {
gl_context = [ [ NSOpenGLContext alloc ] initWithFormat:fmt
shareContext:nil];

[ fmt release ];

if (gl_context == nil) {
SDL_SetError ("Failed creating OpenGL context");
return 0;
Expand Down Expand Up @@ -152,8 +154,6 @@ int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags) {
/* Convince SDL that the GL "driver" is loaded */
this->gl_config.driver_loaded = 1;

[ fmt release ];

return 1;
}

Expand Down
3 changes: 2 additions & 1 deletion src/video/quartz/SDL_QuartzVideo.m
Expand Up @@ -487,9 +487,10 @@ static void QZ_UnsetVideoMode (_THIS) {
else {

[ qz_window close ];
[ qz_window release ];
qz_window = nil;
window_view = nil;

/* Release the OpenGL context */
if ( mode_flags & SDL_OPENGL )
QZ_TearDownOpenGL (this);
Expand Down

0 comments on commit 27a1382

Please sign in to comment.