summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkimcontextwayland.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c
index af195581c8..5bb7ecd04d 100644
--- a/gtk/gtkimcontextwayland.c
+++ b/gtk/gtkimcontextwayland.c
@@ -84,6 +84,9 @@ static GtkIMContextWaylandGlobal *global = NULL;
static void
reset_preedit (GtkIMContextWayland *context)
{
+ if (context->preedit.text == NULL)
+ return;
+
g_clear_pointer (&context->preedit.text, g_free);
context->preedit.cursor_idx = 0;
g_signal_emit_by_name (context, "preedit-changed");