aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/gles2/renderer.c5
-rw-r--r--render/wlr_renderer.c4
-rw-r--r--render/wlr_texture.c4
3 files changed, 6 insertions, 7 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index c512016e..75a47187 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -227,10 +227,6 @@ static bool wlr_gles2_buffer_is_drm(struct wlr_renderer *_renderer,
EGL_TEXTURE_FORMAT, &format);
}
-static void wlr_gles2_destroy(struct wlr_renderer *renderer) {
- free(renderer);
-}
-
static struct wlr_renderer_impl wlr_renderer_impl = {
.begin = wlr_gles2_begin,
.end = wlr_gles2_end,
@@ -240,7 +236,6 @@ static struct wlr_renderer_impl wlr_renderer_impl = {
.render_ellipse = wlr_gles2_render_ellipse,
.formats = wlr_gles2_formats,
.buffer_is_drm = wlr_gles2_buffer_is_drm,
- .destroy = wlr_gles2_destroy
};
struct wlr_renderer *wlr_gles2_renderer_init(struct wlr_backend *backend) {
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index 15b8b999..2f6c7fad 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -8,8 +8,10 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
}
void wlr_renderer_destroy(struct wlr_renderer *r) {
- if (r && r->impl->destroy) {
+ if (r && r->impl && r->impl->destroy) {
r->impl->destroy(r);
+ } else {
+ free(r);
}
}
diff --git a/render/wlr_texture.c b/render/wlr_texture.c
index 72d56c8f..f98284a1 100644
--- a/render/wlr_texture.c
+++ b/render/wlr_texture.c
@@ -9,8 +9,10 @@ void wlr_texture_init(struct wlr_texture *texture,
}
void wlr_texture_destroy(struct wlr_texture *texture) {
- if (texture && texture->impl->destroy) {
+ if (texture && texture->impl && texture->impl->destroy) {
texture->impl->destroy(texture);
+ } else {
+ free(texture);
}
}