mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-29 01:58:26 +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
@ -5,7 +5,7 @@
|
|||||||
* Please see COPYING for details
|
* Please see COPYING for details
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2024 Brenden Matthews, Philip Kovacs, et. al.
|
* Copyright (c) 2005-2024 Brenden Matthews, Philip Kovacs, et. al.
|
||||||
* (see AUTHORS)
|
* (see AUTHORS)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -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