Fixed potential double-free in mouse cleanup code
This commit is contained in:
parent
2d5d813cd9
commit
cb0044cc7d
1 changed files with 5 additions and 5 deletions
|
@ -348,10 +348,9 @@ Cocoa_InitMouse(_THIS)
|
|||
|
||||
Cocoa_InitMouseEventTap(mouse->driverdata);
|
||||
|
||||
SDL_MouseData *driverdata = (SDL_MouseData*)mouse->driverdata;
|
||||
const NSPoint location = [NSEvent mouseLocation];
|
||||
driverdata->lastMoveX = location.x;
|
||||
driverdata->lastMoveY = location.y;
|
||||
mouse->driverdata->lastMoveX = location.x;
|
||||
mouse->driverdata->lastMoveY = location.y;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -482,9 +481,10 @@ Cocoa_QuitMouse(_THIS)
|
|||
if (mouse) {
|
||||
if (mouse->driverdata) {
|
||||
Cocoa_QuitMouseEventTap(((SDL_MouseData*)mouse->driverdata));
|
||||
}
|
||||
|
||||
SDL_free(mouse->driverdata);
|
||||
SDL_free(mouse->driverdata);
|
||||
mouse->driverdata = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue