Skip to content

Commit

Permalink
Mac: Fixed crash when returning from a fullscreen Space on shutdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 15, 2014
1 parent 70cebc7 commit 39bad80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/video/cocoa/SDL_cocoakeyboard.m
Expand Up @@ -565,6 +565,10 @@ - (NSArray *) validAttributesForMarkedText
Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
if (!data) {
return; /* can happen when returning from fullscreen Space on shutdown */
}

unsigned short scancode = [event keyCode];
SDL_Scancode code;
#if 0
Expand Down
5 changes: 4 additions & 1 deletion src/video/cocoa/SDL_cocoamouse.m
Expand Up @@ -349,8 +349,11 @@ + (NSCursor *)invisibleCursor
}

SDL_Mouse *mouse = SDL_GetMouse();

SDL_MouseData *driverdata = (SDL_MouseData*)mouse->driverdata;
if (!driverdata) {
return; /* can happen when returning from fullscreen Space on shutdown */
}

const SDL_bool seenWarp = driverdata->seenWarp;
driverdata->seenWarp = NO;

Expand Down

0 comments on commit 39bad80

Please sign in to comment.