diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-07-13 17:15:21 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-07-13 17:22:26 +0300 |
commit | b0845fc1332bf242237fe858803bcebe87ffd7b3 (patch) | |
tree | 2f54cd8e337b87165637f6f558de3b79e4f7f64d /source/blender/windowmanager/intern/wm_xr.c | |
parent | 70cf8bd9c654a61c174e074d33a0b0cfbf7c2a41 (diff) |
Fix some issues, improve error message
Fixes:
* Destruct surface when destroying session on error. Fixes null pointer
dereference when trying to draw the surface on next redraw.
* Fix trying to enable same extensions/API-layers multiple times due to
static array usage not being cleared after error.
* Null pointer dereference with OpenGL drawing
Diffstat (limited to 'source/blender/windowmanager/intern/wm_xr.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_xr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_xr.c b/source/blender/windowmanager/intern/wm_xr.c index 237040a3db3..f3c5d415d32 100644 --- a/source/blender/windowmanager/intern/wm_xr.c +++ b/source/blender/windowmanager/intern/wm_xr.c @@ -279,7 +279,8 @@ static GHOST_ContextHandle wm_xr_draw_view(const GHOST_XrDrawViewInfo *draw_view wmViewport(&rect); GPU_viewport_draw_to_screen(viewport, &rect); - if (GHOST_isUpsideDownContext(g_xr_surface->secondary_ghost_ctx)) { + if (g_xr_surface->secondary_ghost_ctx && + GHOST_isUpsideDownContext(g_xr_surface->secondary_ghost_ctx)) { GPU_texture_bind(texture, 0); wm_draw_upside_down(draw_view->width, draw_view->height); GPU_texture_unbind(texture); |