|
|
@ -435,6 +435,16 @@ proxy_context_destroy(struct virgl_context *base) |
|
|
|
if (!proxy_client_destroy_context(ctx->client, ctx->base.ctx_id)) |
|
|
|
if (!proxy_client_destroy_context(ctx->client, ctx->base.ctx_id)) |
|
|
|
proxy_log("failed to destroy ctx %d", ctx->base.ctx_id); |
|
|
|
proxy_log("failed to destroy ctx %d", ctx->base.ctx_id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ctx->sync_thread.fence_eventfd >= 0) { |
|
|
|
|
|
|
|
if (ctx->sync_thread.created) { |
|
|
|
|
|
|
|
ctx->sync_thread.stop = true; |
|
|
|
|
|
|
|
write_eventfd(ctx->sync_thread.fence_eventfd, 1); |
|
|
|
|
|
|
|
thrd_join(ctx->sync_thread.thread, NULL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
close(ctx->sync_thread.fence_eventfd); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ctx->shmem.ptr) |
|
|
|
if (ctx->shmem.ptr) |
|
|
|
munmap(ctx->shmem.ptr, ctx->shmem.size); |
|
|
|
munmap(ctx->shmem.ptr, ctx->shmem.size); |
|
|
|
if (ctx->shmem.fd >= 0) |
|
|
|
if (ctx->shmem.fd >= 0) |
|
|
@ -453,16 +463,6 @@ proxy_context_destroy(struct virgl_context *base) |
|
|
|
free(fence); |
|
|
|
free(fence); |
|
|
|
mtx_destroy(&ctx->free_fences_mutex); |
|
|
|
mtx_destroy(&ctx->free_fences_mutex); |
|
|
|
|
|
|
|
|
|
|
|
if (ctx->sync_thread.fence_eventfd >= 0) { |
|
|
|
|
|
|
|
if (ctx->sync_thread.created) { |
|
|
|
|
|
|
|
ctx->sync_thread.stop = true; |
|
|
|
|
|
|
|
write_eventfd(ctx->sync_thread.fence_eventfd, 1); |
|
|
|
|
|
|
|
thrd_join(ctx->sync_thread.thread, NULL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
close(ctx->sync_thread.fence_eventfd); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proxy_socket_fini(&ctx->socket); |
|
|
|
proxy_socket_fini(&ctx->socket); |
|
|
|
|
|
|
|
|
|
|
|
free(ctx); |
|
|
|
free(ctx); |
|
|
|