Commit cfafa414 authored by Adrien Béraud's avatar Adrien Béraud

drawing: fix memory leak in ring_frame_avatar

gdk_pixbuf_new allocates new resources
which are never released.

Change-Id: I32e30217896b2b9ab52587317a5ac6b44c68fe2f
Gitlab: #1008
parent 276dd1b6
......@@ -161,7 +161,7 @@ ring_frame_avatar(GdkPixbuf *avatar) {
cairo_fill(cr);
double radius = new_size/2;
double degrees = M_PI / 180.0;
constexpr double degrees = M_PI / 180.0;
// create the square path with ronded corners
cairo_new_sub_path (cr);
......@@ -186,6 +186,7 @@ ring_frame_avatar(GdkPixbuf *avatar) {
/* free resources */
cairo_destroy(cr);
cairo_surface_destroy(surface);
g_object_unref(crop_avatar);
return pixbuf;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment