mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
llvmpipe: move lp_jit_screen_init() call after allocation of screen object
The screen argument isn't actually used by lp_jit_screen_init() at this time, but let's move the call so that we pass a valid pointer. v2: don't leak screen if lp_jit_screen_init() fails. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
b12899d752
commit
6b65847835
1 changed files with 5 additions and 3 deletions
|
|
@ -557,9 +557,6 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
|
|||
return NULL;
|
||||
#endif
|
||||
|
||||
if (!lp_jit_screen_init(screen))
|
||||
return NULL;
|
||||
|
||||
#ifdef DEBUG
|
||||
LP_DEBUG = debug_get_flags_option("LP_DEBUG", lp_debug_flags, 0 );
|
||||
#endif
|
||||
|
|
@ -570,6 +567,11 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
|
|||
if (!screen)
|
||||
return NULL;
|
||||
|
||||
if (!lp_jit_screen_init(screen)) {
|
||||
FREE(screen);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
screen->winsys = winsys;
|
||||
|
||||
screen->base.destroy = llvmpipe_destroy_screen;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue