mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
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 <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
This commit is contained in:
parent
22897c7497
commit
87f26214d6
1 changed files with 2 additions and 3 deletions
|
|
@ -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: */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue