intel: Clean up several 965 memory leaks on context destroy.
authorEric Anholt <eric@anholt.net>
Wed, 11 Feb 2009 09:15:36 +0000 (01:15 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 17 Feb 2009 18:58:32 +0000 (10:58 -0800)
src/mesa/drivers/dri/i915/i830_context.c
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i965/brw_vtbl.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_screen.c

index fdce8af31f4843f882c234a6ff4aafaaefaa3a79..9c540cb2bb72440d55446947053b90618f2fe320 100644 (file)
@@ -73,6 +73,8 @@ i830CreateContext(const __GLcontextModes * mesaVis,
       return GL_FALSE;
    }
 
+   _math_matrix_ctr(&intel->ViewportMatrix);
+
    /* Initialize swrast, tnl driver tables: */
    intelInitSpanFuncs(ctx);
    intelInitTriFuncs(ctx);
index 6e2d41e19ab3ce41deb49c90a6fe7310439a61bf..7549029a1be909b9fd68aa1d7368451c63348258 100644 (file)
@@ -119,6 +119,8 @@ i915CreateContext(const __GLcontextModes * mesaVis,
       return GL_FALSE;
    }
 
+   _math_matrix_ctr(&intel->ViewportMatrix);
+
    /* Initialize swrast, tnl driver tables: */
    intelInitSpanFuncs(ctx);
    intelInitTriFuncs(ctx);
index b501a59ccd5128a3e220a8d06c7741d0c84a1bc5..15ceac6ba1e4dbf130aa3214f86eeaa54f4be0be 100644 (file)
@@ -67,6 +67,8 @@ static void brw_destroy_context( struct intel_context *intel )
    brw_destroy_state(brw);
    brw_draw_destroy( brw );
 
+   _mesa_free(brw->wm.compile_data);
+
    brw_FrameBufferTexDestroy( brw );
 
    for (i = 0; i < brw->state.nr_draw_regions; i++)
@@ -90,6 +92,7 @@ static void brw_destroy_context( struct intel_context *intel )
    dri_bo_release(&brw->wm.bind_bo);
    for (i = 0; i < BRW_WM_MAX_SURF; i++)
       dri_bo_release(&brw->wm.surf_bo[i]);
+   dri_bo_release(&brw->wm.sampler_bo);
    dri_bo_release(&brw->wm.prog_bo);
    dri_bo_release(&brw->wm.state_bo);
    dri_bo_release(&brw->cc.prog_bo);
index d7ccfa0605890e43c179510e719a4862bc3dcf29..1aa173db181e0ea1d82c511c1c9f6431c6f288f1 100644 (file)
@@ -573,8 +573,6 @@ intelInitContext(struct intel_context *intel,
 
    intel->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS);
 
-   _math_matrix_ctr(&intel->ViewportMatrix);
-
    if (IS_965(intelScreen->deviceID) && !intel->intelScreen->irq_active) {
       _mesa_printf("IRQs not active.  Exiting\n");
       exit(1);
index a52271158c6bf43bea362d7ad7658aa47b7d753b..d6110b8163ac954f018ea8692e06186848e3fbf6 100644 (file)
@@ -302,6 +302,7 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv)
 
    dri_bufmgr_destroy(intelScreen->bufmgr);
    intelUnmapScreenRegions(intelScreen);
+   driDestroyOptionCache(&intelScreen->optionCache);
 
    FREE(intelScreen);
    sPriv->private = NULL;