Skip to content

Commit ffb045d

Browse files
authored
properly destroy cairo (#52)
fixes a small memory leak
1 parent 130f5f1 commit ffb045d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/osd.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,8 @@ void modeset_paint_buffer(struct modeset_buf *buf, Osd *osd) {
14211421
}
14221422

14231423
if (!osd_vars.enable_telemetry){
1424+
cairo_destroy(cr);
1425+
cairo_surface_destroy(surface);
14241426
return;
14251427
}
14261428

@@ -1529,6 +1531,7 @@ void modeset_paint_buffer(struct modeset_buf *buf, Osd *osd) {
15291531

15301532
cairo_fill(cr);
15311533
cairo_destroy(cr);
1534+
cairo_surface_destroy(surface);
15321535
}
15331536

15341537
int osd_thread_signal;

0 commit comments

Comments
 (0)