From 2ec350ff1d9f13ec95d7b9d46f57ad9b9efcc8ea Mon Sep 17 00:00:00 2001 From: Christian König Date: Fri, 8 Jul 2011 12:03:13 +0200 Subject: [g3dvl] make pipe_context mandatory for creation pipe_video_context --- src/gallium/winsys/g3dvl/xlib/xsp_winsys.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/gallium/winsys/g3dvl/xlib') diff --git a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c index 1a67e2436e4..3caf6603243 100644 --- a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c +++ b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c @@ -172,18 +172,26 @@ void vl_screen_destroy(struct vl_screen *vscreen) struct vl_context* vl_video_create(struct vl_screen *vscreen) { + struct pipe_video_context *pipe; struct pipe_video_context *vpipe; struct vl_context *vctx; assert(vscreen); assert(vscreen->pscreen->video_context_create); - vpipe = vscreen->pscreen->video_context_create(vscreen->pscreen, NULL); - if (!vpipe) + pipe = vscreen->pscreen->context_create(vscreen->pscreen, NULL); + if (!pipe) return NULL; + vpipe = vscreen->pscreen->video_context_create(vscreen->pscreen, pipe, NULL); + if (!vpipe) { + pipe->destroy(pipe); + return NULL; + } + vctx = CALLOC_STRUCT(vl_context); if (!vctx) { + pipe->destroy(pipe); vpipe->destroy(vpipe); return NULL; } @@ -199,6 +207,7 @@ void vl_video_destroy(struct vl_context *vctx) { assert(vctx); + vctx->pipe->destroy(vctx->pipe); vctx->vpipe->destroy(vctx->vpipe); FREE(vctx); } -- cgit v1.2.3