Skip to content

Commit 9412dc7

Browse files
committed
Merge pull request #582 from cl91/fix-memory-leaks
Plug two memory leaks
2 parents 3b5a8cb + 91d2a50 commit 9412dc7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

sway/border.c

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ int get_font_text_height(const char *font) {
8686
cairo_t *cr = cairo_create(surface);
8787
int width, height;
8888
get_text_size(cr, font, &width, &height, "Gg");
89+
cairo_surface_destroy(surface);
90+
cairo_destroy(cr);
8991
return height;
9092
}
9193

sway/container.c

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static void free_swayc(swayc_t *cont) {
6464
if (cont->bg_pid != 0) {
6565
terminate_swaybg(cont->bg_pid);
6666
}
67+
free(cont->border);
6768
free(cont);
6869
}
6970

0 commit comments

Comments
 (0)