diff options
author | Dave Airlie <airlied@redhat.com> | 2009-04-01 15:41:58 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-04-01 15:41:58 +1000 |
commit | 6e30fe4873f30ccf9edec9ab6113ea647dccb9b7 (patch) | |
tree | 26959068931ca6945e7af79c50a8ff268197303c /src/mesa/drivers/dri/radeon/radeon_common_context.c | |
parent | d81a48757a9bde35299fd7c3cfbe83885238409a (diff) |
radeon: fixup render buffer cleanups
this fixes qtdemo-qt4 starting and a leak in glxgears exit
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_common_context.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_common_context.c | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 5766c9ec7b..9103c8c0f6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -37,6 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #include "vblank.h" #include "drirenderbuffer.h" +#include "main/framebuffer.h" #include "main/state.h" #define DRIVER_DATE "20090101" @@ -183,45 +184,14 @@ void radeonCleanupContext(radeonContextPtr radeon) #ifdef RADEON_BO_TRACK FILE *track; #endif - struct radeon_renderbuffer *rb; struct radeon_framebuffer *rfb; + radeonDestroyBuffer(radeon->dri.drawable); + radeonDestroyBuffer(radeon->dri.readable); + /* free the Mesa context */ _mesa_destroy_context(radeon->glCtx); - - rfb = (void*)radeon->dri.drawable->driverPrivate; - rb = rfb->color_rb[0]; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = rfb->color_rb[1]; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = radeon_get_renderbuffer(&rfb->base, BUFFER_DEPTH); - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rfb = (void*)radeon->dri.readable->driverPrivate; - rb = rfb->color_rb[0]; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = rfb->color_rb[1]; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = radeon_get_renderbuffer(&rfb->base, BUFFER_DEPTH); - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - + /* _mesa_destroy_context() might result in calls to functions that * depend on the DriverCtx, so don't set it to NULL before. * |