mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-30 02:28:31 +00:00
lua-imlib2: fix memory leak
If you frequently use this function to draw new images this leak becomes quite significant
This commit is contained in:
parent
a0ee703ee2
commit
9449818c4d
@ -61,7 +61,6 @@ void cairo_place_image(const char *file, cairo_t *cr, int x, int y,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create scaled version of image to later extract the alpha channel */
|
|
||||||
alpha_image = imlib_create_cropped_scaled_image(0, 0, w, h, width, height);
|
alpha_image = imlib_create_cropped_scaled_image(0, 0, w, h, width, height);
|
||||||
|
|
||||||
/* create temporary image */
|
/* create temporary image */
|
||||||
@ -151,6 +150,8 @@ void cairo_draw_image(const char *file, cairo_surface_t *cs, int x, int y,
|
|||||||
|
|
||||||
cr = cairo_create(cs);
|
cr = cairo_create(cs);
|
||||||
cairo_place_image(file, cr, x, y, scaled_w, scaled_h, 1.0);
|
cairo_place_image(file, cr, x, y, scaled_w, scaled_h, 1.0);
|
||||||
|
imlib_context_set_image(image);
|
||||||
|
imlib_free_image_and_decache();
|
||||||
|
|
||||||
cairo_destroy(cr);
|
cairo_destroy(cr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user