summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/xterm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c
index e2ad0b48f58..64bee110227 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -16584,6 +16584,11 @@ x_delete_display (struct x_display_info *dpyinfo)
xfree (dpyinfo->x_dnd_atoms);
xfree (dpyinfo->color_cells);
xfree (dpyinfo);
+
+#ifdef HAVE_XINPUT2
+ if (dpyinfo->supports_xi2)
+ x_free_xi_devices (dpyinfo);
+#endif
}
#ifdef USE_X_TOOLKIT
@@ -16729,10 +16734,6 @@ x_delete_terminal (struct terminal *terminal)
if (dpyinfo->xkb_desc)
XkbFreeKeyboard (dpyinfo->xkb_desc, XkbAllComponentsMask, True);
#endif
-#ifdef HAVE_XINPUT2
- if (dpyinfo->supports_xi2)
- x_free_xi_devices (dpyinfo);
-#endif
#ifdef USE_GTK
xg_display_close (dpyinfo->display);
#else