diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-14 08:39:21 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-14 08:43:17 -0400 |
commit | 2facf1df65742a1f4ae6977c8a54bc14643c6c1b (patch) | |
tree | cbe9f923104ee4b7ddae3194d34fc647c4b1b67b /render | |
parent | de6f32c84e222861c6fed27acab99c568cd6fd66 (diff) |
Fix software cursors
Diffstat (limited to 'render')
-rw-r--r-- | render/gles2/renderer.c | 6 | ||||
-rw-r--r-- | render/wlr_renderer.c | 2 | ||||
-rw-r--r-- | render/wlr_texture.c | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 17452e9a..c512016e 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -245,10 +245,12 @@ static struct wlr_renderer_impl wlr_renderer_impl = { struct wlr_renderer *wlr_gles2_renderer_init(struct wlr_backend *backend) { init_globals(); - struct wlr_egl *egl = wlr_backend_get_egl(backend); struct wlr_gles2_renderer *renderer = calloc(1, sizeof(struct wlr_gles2_renderer)); wlr_renderer_init(&renderer->wlr_renderer, &wlr_renderer_impl); - renderer->egl = egl; + if (backend) { + struct wlr_egl *egl = wlr_backend_get_egl(backend); + renderer->egl = egl; + } return &renderer->wlr_renderer; } diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 1afba6e3..15b8b999 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -8,7 +8,7 @@ void wlr_renderer_init(struct wlr_renderer *renderer, } void wlr_renderer_destroy(struct wlr_renderer *r) { - if (r->impl->destroy) { + if (r && r->impl->destroy) { r->impl->destroy(r); } } diff --git a/render/wlr_texture.c b/render/wlr_texture.c index d2bcca07..72d56c8f 100644 --- a/render/wlr_texture.c +++ b/render/wlr_texture.c @@ -9,7 +9,7 @@ void wlr_texture_init(struct wlr_texture *texture, } void wlr_texture_destroy(struct wlr_texture *texture) { - if (texture->impl->destroy) { + if (texture && texture->impl->destroy) { texture->impl->destroy(texture); } } |