aboutsummaryrefslogtreecommitdiff
path: root/render/wlr_texture.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-08-14 16:16:20 +0200
committerDominique Martinet <asmadeus@codewreck.org>2017-08-14 16:22:31 +0200
commit4bbf718e7dca39e2838cce7c07c89faffd73840a (patch)
tree900834e7168410f2728ce4a6eb0ddb6116512f9a /render/wlr_texture.c
parentba20d5b3cae29a90b1d66c9d53f295a7c41c932e (diff)
impl->destroy cleanup:
- remove trivial destroy() function - make sure we check impl and impl->destroy before calling - always call free if not implemented
Diffstat (limited to 'render/wlr_texture.c')
-rw-r--r--render/wlr_texture.c4
1 files changed, 3 insertions, 1 deletions
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);
}
}