Skip to content

Commit

Permalink
Cocoa Port: Fix a longstanding, yet rare, crash that may occur when q…
Browse files Browse the repository at this point in the history
…uitting the app.
  • Loading branch information
rogerman committed Jul 2, 2024
1 parent d4163a1 commit fe0ae83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions desmume/src/frontend/cocoa/cocoa_GPU.mm
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ - (id)init

- (void)dealloc
{
DestroyOpenGLRenderer();

delete fetchObject;
delete gpuEvent;

Expand Down
4 changes: 4 additions & 0 deletions desmume/src/frontend/cocoa/cocoa_core.mm
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ - (void)dealloc
delete execControl;
NDS_DeInit();

// We must call DestroyOpenGLRenderer() after NDS_Init() because we need to wait for
// the OpenGL renderer to finish before we destroy its associated context.
DestroyOpenGLRenderer();

[super dealloc];
}

Expand Down

0 comments on commit fe0ae83

Please sign in to comment.