Extra cleanup at exit.

This commit is contained in:
Dave Davenport 2016-08-22 08:39:22 +02:00
parent 284b3cb78b
commit ad53de507c
2 changed files with 26 additions and 0 deletions

View File

@ -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++ ) {

View File

@ -37,6 +37,7 @@
#include <xcb/xcb.h>
#include <xcb/randr.h>
#include <xcb/xcb_ewmh.h>
#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;