diff options
author | Brian Paul <[email protected]> | 2004-04-21 16:11:27 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-04-21 16:11:27 +0000 |
commit | c45b7364dab6c3daebc1f1d8d11124af4129074a (patch) | |
tree | 7b887833cbe2c9182a327fe24b82362d487dba93 /src/mesa/drivers/osmesa | |
parent | f693b1dc2ef78aab08e0aef40d1ee77b89533ef0 (diff) |
check return values of _swrast_CreateContext, etc
Diffstat (limited to 'src/mesa/drivers/osmesa')
-rw-r--r-- | src/mesa/drivers/osmesa/osmesa.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index a8e6b12832d..7932b90f597 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -980,10 +980,15 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, { GLcontext *ctx = &osmesa->mesa; - _swrast_CreateContext( ctx ); - _ac_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); + if (!_swrast_CreateContext( ctx ) || + !_ac_CreateContext( ctx ) || + !_tnl_CreateContext( ctx ) || + !_swsetup_CreateContext( ctx )) { + _mesa_destroy_visual(osmesa->gl_visual); + _mesa_free_context_data(ctx); + _mesa_free(osmesa); + return NULL; + } _swsetup_Wakeup( ctx ); hook_in_driver_functions( ctx ); |