struct pipe_winsys *ws = pipe->winsys;
uint i;
- draw_destroy( softpipe->draw );
+ if (softpipe->draw)
+ draw_destroy( softpipe->draw );
softpipe->quad.polygon_stipple->destroy( softpipe->quad.polygon_stipple );
softpipe->quad.earlyz->destroy( softpipe->quad.earlyz );
* Create drawing context and plug our rendering stage into it.
*/
softpipe->draw = draw_create();
- assert(softpipe->draw);
+ if (!softpipe->draw)
+ goto fail;
+
softpipe->setup = sp_draw_render_stage(softpipe);
+ if (!softpipe->setup)
+ goto fail;
if (GETENV( "SP_NO_RAST" ) != NULL)
softpipe->no_rast = TRUE;
sp_init_surface_functions(softpipe);
return &softpipe->pipe;
+
+ fail:
+ softpipe_destroy(&softpipe->pipe);
+ return NULL;
}