vrend: Use the original context to delete objects.

Container objects like framebuffers are not shared between contexts
and we have to delete them in the original context. Otherwise we
could delete wrong objects which is in using by others.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Lepton Wu 5 years ago
parent 63bcca251f
commit 845bc4889b
  1. 6
      src/vrend_renderer.c

@ -5873,6 +5873,8 @@ static void vrend_destroy_sub_context(struct vrend_sub_context *sub)
int i, j;
struct vrend_streamout_object *obj, *tmp;
vrend_clicbs->make_current(sub->gl_context);
if (sub->fb_id)
glDeleteFramebuffers(1, &sub->fb_id);
@ -5968,9 +5970,9 @@ bool vrend_destroy_context(struct vrend_context *ctx)
vrend_set_index_buffer(ctx, 0, 0, 0);
vrend_renderer_force_ctx_0();
LIST_FOR_EACH_ENTRY_SAFE(sub, tmp, &ctx->sub_ctxs, head)
vrend_destroy_sub_context(sub);
vrend_renderer_force_ctx_0();
vrend_object_fini_ctx_table(ctx->res_hash);
@ -10209,9 +10211,9 @@ void vrend_renderer_destroy_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
if (tofree) {
if (ctx->sub == tofree) {
ctx->sub = ctx->sub0;
vrend_clicbs->make_current(ctx->sub->gl_context);
}
vrend_destroy_sub_context(tofree);
vrend_clicbs->make_current(ctx->sub->gl_context);
}
}

Loading…
Cancel
Save