aboutsummaryrefslogtreecommitdiff
path: root/swaybar
diff options
context:
space:
mode:
authorNathan Schulte <nmschulte@gmail.com>2021-09-14 04:02:49 -0500
committerSimon Ser <contact@emersion.fr>2021-10-08 09:33:03 +0200
commit83310f5abf1fd9937a9f734da4015aacd54fd112 (patch)
tree66343b18ae2261dae4305cf289fab9113da3cc93 /swaybar
parenta47f8ef478cd6ee26b0a362884e78b2190169d39 (diff)
swaybar: fix cairo_font_options leak
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/render.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 92b73f4c..dcde6b9e 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -813,9 +813,7 @@ void render_frame(struct swaybar_output *output) {
output->width * output->scale,
output->height * output->scale);
if (!output->current_buffer) {
- cairo_surface_destroy(recorder);
- cairo_destroy(cairo);
- return;
+ goto cleanup;
}
cairo_t *shm = output->current_buffer->cairo;
@@ -840,6 +838,7 @@ void render_frame(struct swaybar_output *output) {
wl_surface_commit(output->surface);
}
+cleanup:
if (ctx.textaa_sharp != ctx.textaa_safe) {
cairo_font_options_destroy(ctx.textaa_sharp);
}