bar: call cairo_device_finish() on the surface's device

This fixes lots of memory leaks detected by valgrind.

Unsure if this is how you're supposed to shutdown cairo. You'd
think (from the documentation) that destroying the surface would (when
the refcount reaches 0) destroy the device too...
This commit is contained in:
Daniel Eklöf 2019-01-09 18:46:24 +01:00
parent b2c9c386d9
commit 8dfe4af76b

2
bar.c
View file

@ -702,6 +702,8 @@ run(struct bar_run_context *run_ctx)
}
cairo_destroy(bar->cairo);
cairo_device_finish(cairo_surface_get_device(bar->cairo_surface));
cairo_surface_finish(bar->cairo_surface);
cairo_surface_destroy(bar->cairo_surface);
cairo_debug_reset_static_data();