x11: Check for a valid input context before destroying it
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled

XDestroyIC crashes if passed a null parameter.
This commit is contained in:
Frank Praznik
2025-09-30 14:30:14 -04:00
parent 8a5f9a3837
commit b54c5fd79c
+4 -1
View File
@@ -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;