mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
scaled_font_buffer.c: simplify calls to zfree()
There is no need to check foo != NULL before zfree(foo)
This commit is contained in:
parent
429df42a8f
commit
a610aff946
1 changed files with 4 additions and 12 deletions
|
|
@ -30,12 +30,8 @@ static void
|
|||
_destroy(struct scaled_scene_buffer *scaled_buffer)
|
||||
{
|
||||
struct scaled_font_buffer *self = scaled_buffer->data;
|
||||
if (self->text) {
|
||||
zfree(self->text);
|
||||
}
|
||||
if (self->font.name) {
|
||||
zfree(self->font.name);
|
||||
}
|
||||
zfree(self->arrow);
|
||||
zfree(scaled_buffer->data);
|
||||
}
|
||||
|
|
@ -79,12 +75,8 @@ scaled_font_buffer_update(struct scaled_font_buffer *self, const char *text,
|
|||
assert(color);
|
||||
|
||||
/* Clean up old internal state */
|
||||
if (self->text) {
|
||||
zfree(self->text);
|
||||
}
|
||||
if (self->font.name) {
|
||||
zfree(self->font.name);
|
||||
}
|
||||
zfree(self->arrow);
|
||||
|
||||
/* Update internal state */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue