mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 08:28:29 +00:00
x11: Check for a valid input context before destroying it
XDestroyIC crashes if passed a null parameter.
This commit is contained in:
@@ -770,7 +770,10 @@ void X11_CreateInputContext(SDL_WindowData *data)
|
||||
void X11_DestroyInputContext(SDL_WindowData *data)
|
||||
{
|
||||
#ifdef X_HAVE_UTF8_STRING
|
||||
X11_XDestroyIC(data->ic);
|
||||
if (data->ic) {
|
||||
X11_XDestroyIC(data->ic);
|
||||
data->ic = NULL;
|
||||
}
|
||||
SDL_free(data->preedit_text);
|
||||
SDL_free(data->preedit_feedback);
|
||||
data->preedit_text = NULL;
|
||||
|
Reference in New Issue
Block a user