diff --git a/source/rofi.c b/source/rofi.c index 0215fdc9..1f7f290f 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -288,8 +288,32 @@ static void cleanup () g_main_loop_unref ( main_loop ); main_loop = NULL; } + // XKB Cleanup + // + if ( xkb.compose.state != NULL ) { + xkb_compose_state_unref ( xkb.compose.state ); + xkb.compose.state = NULL; + } + if ( xkb.compose.table != NULL ) { + xkb_compose_table_unref ( xkb.compose.table ); + xkb.compose.table = NULL; + } + if ( xkb.state != NULL ) { + xkb_state_unref ( xkb.state ); + xkb.state = NULL; + } + if ( xkb.keymap != NULL ) { + xkb_keymap_unref ( xkb.keymap ); + xkb.keymap = NULL; + } + if ( xkb.context != NULL ) { + xkb_context_unref ( xkb.context ); + xkb.context = NULL; + } + // Cleanup xcb_stuff_wipe ( xcb ); + // Cleaning up memory allocated by the Xresources file. config_xresource_free (); for ( unsigned int i = 0; i < num_modi; i++ ) { diff --git a/source/x11-helper.c b/source/x11-helper.c index bebfea8a..560ce39f 100644 --- a/source/x11-helper.c +++ b/source/x11-helper.c @@ -37,6 +37,7 @@ #include #include +#include #include "xcb-internal.h" #include "xcb.h" #include "settings.h" @@ -882,6 +883,7 @@ void xcb_stuff_wipe ( xcb_stuff *xcb ) } x11_monitors_free (); xcb_disconnect ( xcb->connection ); + xcb_ewmh_connection_wipe ( &( xcb->ewmh ) ); xcb->connection = NULL; xcb->screen = NULL; xcb->screen_nbr = 0;