summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-02-11 01:15:36 -0800
committerEric Anholt <eric@anholt.net>2009-02-17 10:58:32 -0800
commit60953059ea2319eae4d737831824dbce08ee1725 (patch)
treed496cdfc3d95c3704f6758cb0b52b90bb96d8038
parentbaef7c5474d302f1bc9997b09948fd6b883ec60d (diff)
intel: Clean up several 965 memory leaks on context destroy.
-rw-r--r--src/mesa/drivers/dri/i915/i830_context.c2
-rw-r--r--src/mesa/drivers/dri/i915/i915_context.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vtbl.c3
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c1
5 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c
index fdce8af31f..9c540cb2bb 100644
--- a/src/mesa/drivers/dri/i915/i830_context.c
+++ b/src/mesa/drivers/dri/i915/i830_context.c
@@ -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);
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index 6e2d41e19a..7549029a1b 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -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);
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index b501a59ccd..15ceac6ba1 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -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);
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index d7ccfa0605..1aa173db18 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -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);
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index a52271158c..d6110b8163 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -302,6 +302,7 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv)
dri_bufmgr_destroy(intelScreen->bufmgr);
intelUnmapScreenRegions(intelScreen);
+ driDestroyOptionCache(&intelScreen->optionCache);
FREE(intelScreen);
sPriv->private = NULL;