diff options
author | Tuomas Siipola <tuomas@zpl.fi> | 2020-07-06 18:39:25 +0300 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2020-07-21 01:47:24 +0100 |
commit | a200fbf945557100eace0c9104c0ed2542ca47ee (patch) | |
tree | 1d78129b8e3821aa2f08b7f5ef90ec61244a0a36 | |
parent | 32c33c028dfdc015a77ee8fefcadf3c5ee8ee07f (diff) | |
download | imv-a200fbf945557100eace0c9104c0ed2542ca47ee.tar.gz |
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.
-rw-r--r-- | src/image.c | 3 |
1 files changed, 1 insertions, 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 |