struct list_head link;
pid_t pid;
char name[TDM_NAME_LEN];
+ struct wl_resource *resource;
} tdm_server_client_info;
static tdm_private_server *keep_private_server;
{
tdm_server_client_info *c = NULL, *cc = NULL;
struct wl_client *client;
- pid_t pid = -1;
client = wl_resource_get_client(resource);
TDM_RETURN_IF_FAIL(client != NULL);
- wl_client_get_credentials(client, &pid, NULL, NULL);
-
LIST_FOR_EACH_ENTRY_SAFE(c, cc, &client_list, link) {
- if (c->pid == pid) {
+ if (c->resource == resource) {
LIST_DEL(&c->link);
free(c);
return;
return;
}
+ cinfo->resource = resource;
+
LIST_ADDTAIL(&cinfo->link, &client_list);
wl_client_get_credentials(client, &cinfo->pid, NULL, NULL);
_tdm_server_get_process_name(cinfo->pid, cinfo->name, TDM_NAME_LEN);
wl_resource_destroy(o->resource);
}
+ LIST_FOR_EACH_ENTRY_SAFE(c, cc, &client_list, link) {
+ wl_resource_destroy(c->resource);
+ }
+
free(private_server);
private_loop->private_server = NULL;
keep_private_server = NULL;
-
- LIST_FOR_EACH_ENTRY_SAFE(c, cc, &client_list, link) {
- LIST_DEL(&c->link);
- free(c);
- }
}
INTERN const char*