--- src/mesa/drivers/dri/i965/brw_context.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 9ced230ec14..98ec54f2ae3 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -1099,6 +1099,14 @@ intelDestroyContext(__DRIcontext * driContextPriv) (struct brw_context *) driContextPriv->driverPrivate; struct gl_context *ctx = &brw->ctx; + /* Wait for our any outstanding rendering to be completed before we start + * freeing anything. It's probably safe to destroy the context while stuff + * is sill in flight since the kernel will reference count our BOs. This + * just ensures that everything is safe before we start destroying things + * in case doing so has any side-effects. + */ + intel_finish(ctx); + _mesa_meta_free(&brw->ctx); if (INTEL_DEBUG & DEBUG_SHADER_TIME) { -- 2.17.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev