Only free EventData if it's successfully retrieved.
- straight from http://who-t.blogspot.com/2009/07/xi2-and-xlib-cookies.html - hopefully fixes random crash on some systems
This commit is contained in:
parent
9e842c74c1
commit
0ce4bb89d8
1 changed files with 5 additions and 4 deletions
|
@ -187,10 +187,11 @@ static char* X11_URIToLocal(char* uri) {
|
|||
#if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
|
||||
static void X11_HandleGenericEvent(SDL_VideoData *videodata,XEvent event)
|
||||
{
|
||||
XGenericEventCookie *cookie = &event.xcookie;
|
||||
XGetEventData(videodata->display, cookie);
|
||||
X11_HandleXinput2Event(videodata,cookie);
|
||||
XFreeEventData(videodata->display,cookie);
|
||||
if (XGetEventData(videodata->display, &event)) {
|
||||
XGenericEventCookie *cookie = &event.xcookie;
|
||||
X11_HandleXinput2Event(videodata, cookie);
|
||||
XFreeEventData(videodata->display, cookie);
|
||||
}
|
||||
}
|
||||
#endif /* SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue