程序结束时清理 xcb 模块环境
This commit is contained in:
@@ -225,3 +225,22 @@ void free_window_list(window_list_t *window_list) {
|
||||
free(window_list->list);
|
||||
free(window_list);
|
||||
}
|
||||
|
||||
void clean_xcb(void) {
|
||||
if (wm_check_window != XCB_NONE) {
|
||||
xcb_destroy_window(conn, wm_check_window);
|
||||
wm_check_window = XCB_NONE;
|
||||
}
|
||||
|
||||
if (ewmh) {
|
||||
if (!ewmh_init_failed) {
|
||||
xcb_ewmh_connection_wipe(ewmh);
|
||||
}
|
||||
ewmh_init_failed = false;
|
||||
ewmh = NULL;
|
||||
}
|
||||
|
||||
xcb_disconnect(conn);
|
||||
conn = NULL;
|
||||
screen = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user