use warnings;
use v5.10;
-use i3test i3_autostart => 0;
+use Test::More;
+use i3test::Util qw(get_socket_path);
+use lib qw(@abs_top_srcdir@/AnyEvent-I3/blib/lib);
use AnyEvent::I3;
use ExtUtils::PkgConfig;
if ((conn = xcb_connect(NULL, &screen)) == NULL ||
xcb_connection_has_error(conn)) {
+ if (conn != NULL) {
+ xcb_disconnect(conn);
+ }
fprintf(stderr, "Could not connect to X11\n");
return false;
}
conn, xcb_xkb_use_extension(conn, XCB_XKB_MAJOR_VERSION, XCB_XKB_MINOR_VERSION), &err);
if (err != NULL || usereply == NULL) {
fprintf(stderr, "xcb_xkb_use_extension() failed\n");
+ free(err);
return false;
}
free(usereply);
bool set_xkb_group(int group) {
xcb_generic_error_t *err = NULL;
// Needs libxcb ≥ 1.11 so that we have the following bug fix:
- // http://cgit.freedesktop.org/xcb/proto/commit/src/xkb.xml?id=8d7ee5b6ba4cf343f7df70372a3e1f85b82aeed7
+ // https://cgit.freedesktop.org/xcb/proto/commit/src/xkb.xml?id=8d7ee5b6ba4cf343f7df70372a3e1f85b82aeed7
xcb_void_cookie_t cookie = xcb_xkb_latch_lock_state_checked(
conn,
XCB_XKB_ID_USE_CORE_KBD, /* deviceSpec */
0); /* groupLatch */
if ((err = xcb_request_check(conn, cookie)) != NULL) {
fprintf(stderr, "X error code %d\n", err->error_code);
+ free(err);
return false;
}
return true;
XCB_NONE); /* deviceid */
if ((err = xcb_request_check(conn, cookie)) != NULL) {
fprintf(stderr, "X error code %d\n", err->error_code);
+ free(err);
return false;
}