summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-08-31 14:55:21 -0700
committerIan Romanick <[email protected]>2012-09-28 15:05:24 -0700
commit87f26214d6bdeb439b30615ec53c293c5141cf11 (patch)
treed9cb21325f1f0875a850e14b382f52c24a7bc734 /src/mesa/drivers/dri
parent22897c74979aa02facdd5cd729db8dadf86924f5 (diff)
i965: Don't free the intel_context structure when intelCreateContext fails.
intelDestroyContext will eventually be called, and it will clean things up. The call to brwInitVtbl is moved earlier so that intelDestroyContext can call the device-specific destructor. This also makes the code look more like the i915 code. NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 1083e28ce3b..418c8737145 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -140,6 +140,8 @@ brwCreateContext(int api,
return false;
}
+ brwInitVtbl( brw );
+
brwInitDriverFunctions(screen, &functions);
struct intel_context *intel = &brw->intel;
@@ -148,13 +150,10 @@ brwCreateContext(int api,
if (!intelInitContext( intel, api, mesaVis, driContextPriv,
sharedContextPrivate, &functions )) {
printf("%s: failed to init intel context\n", __FUNCTION__);
- free(brw);
*error = __DRI_CTX_ERROR_NO_MEMORY;
return false;
}
- brwInitVtbl( brw );
-
brw_init_surface_formats(brw);
/* Initialize swrast, tnl driver tables: */