}
static void
+client_disconnect_nocheck(struct client *c)
+{
+ wl_proxy_destroy((struct wl_proxy *) c->tc);
+ wl_display_disconnect(c->wl_display);
+ free(c);
+}
+
+static void
post_error_main(void)
{
struct client *c = client_connect();
/* don't call client_disconnect(c), because then the test would be
* aborted due to checks for error in this function */
wl_proxy_destroy((struct wl_proxy *) seat);
- wl_proxy_destroy((struct wl_proxy *) c->tc);
- wl_display_disconnect(c->wl_display);
+ client_disconnect_nocheck(c);
}
TEST(post_error_to_one_client)
/* don't call client_disconnect(c), because then the test would be
* aborted due to checks for error in this function */
wl_proxy_destroy((struct wl_proxy *) seat);
- wl_proxy_destroy((struct wl_proxy *) c->tc);
- wl_display_disconnect(c->wl_display);
+ client_disconnect_nocheck(c);
}
/* all the testcases could be in one TEST, but splitting it
assert(wl_display_get_error(c->wl_display) == ENOMEM);
wl_proxy_destroy((struct wl_proxy *) seat);
- wl_proxy_destroy((struct wl_proxy *) c->tc);
- wl_display_disconnect(c->wl_display);
+ client_disconnect_nocheck(c);
}
TEST(post_nomem_tst)
test_set_timeout(3);
pthread_join(thread, NULL);
- wl_proxy_destroy((struct wl_proxy *) c->tc);
- wl_display_disconnect(c->wl_display);
+ client_disconnect_nocheck(c);
}
TEST(threading_errors_tst)
test_set_timeout(3);
pthread_join(thread, NULL);
- wl_proxy_destroy((struct wl_proxy *) c->tc);
- wl_display_disconnect(c->wl_display);
+ client_disconnect_nocheck(c);
}
TEST(threading_read_after_error_tst)