From a200fbf945557100eace0c9104c0ed2542ca47ee Mon Sep 17 00:00:00 2001 From: Tuomas Siipola Date: Mon, 6 Jul 2020 18:39:25 +0300 Subject: Fix librsvg usage to prevent memory leak Calling `rsvg_handle_close` doesn't do anything here because the handle is already constructed with data or file. `g_object_unref` is called instead to free memory. --- src/image.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/image.c b/src/image.c index e4cda9d..4610fdb 100644 --- a/src/image.c +++ b/src/image.c @@ -48,8 +48,7 @@ void imv_image_free(struct imv_image *image) #ifdef IMV_BACKEND_LIBRSVG if (image->svg) { - GError *error = NULL; - rsvg_handle_close(image->svg, &error); + g_object_unref(image->svg); } #endif -- cgit v1.2.3