mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
x11: Check for a valid input context before destroying it
XDestroyIC crashes if passed a null parameter.
This commit is contained in:
parent
8a5f9a3837
commit
b54c5fd79c
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue