mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
impl->destroy cleanup:
- remove trivial destroy() function - make sure we check impl and impl->destroy before calling - always call free if not implemented
This commit is contained in:
parent
ba20d5b3ca
commit
4bbf718e7d
6 changed files with 11 additions and 10 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue