[Mesa-dev] [PATCH 2/4] intel: Don't call intelDestroyContext if there is no context to destroy

Ian Romanick idr at freedesktop.org
Fri Sep 28 08:55:56 PDT 2012


From: Ian Romanick <ian.d.romanick at intel.com>

Some error paths in the device-specific context creation functions can exit
before the deintel_context structure is allocated.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/drivers/dri/intel/intel_screen.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 5cb7e5d..d6e6408 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -821,7 +821,9 @@ intelCreateContext(gl_api api,
    if (success)
       return true;
 
-   intelDestroyContext(driContextPriv);
+   if (driContextPriv->driverPrivate != NULL)
+      intelDestroyContext(driContextPriv);
+
    return false;
 }
 
-- 
1.7.11.4



More information about the mesa-dev mailing list