From fda2a4ec74543dad97cc47f369accf592409d43f Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sat, 20 Mar 2021 16:37:56 +0100 Subject: [PATCH] fix issue introduced with 85df1e7f980f0f7092523e5ac9ed4ff6db51d82e: (process:24445): librsvg-CRITICAL **: 16:03:34.427: rsvg_handle_read_stream_sync: assertion 'is_input_stream(stream)' failed --- extensions/imageloader.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/extensions/imageloader.c b/extensions/imageloader.c index bd702ad..59e4c3e 100644 --- a/extensions/imageloader.c +++ b/extensions/imageloader.c @@ -178,14 +178,22 @@ cImageImporterSVG::cImageImporterSVG() { cImageImporterSVG::~cImageImporterSVG() { if (handle) { - rsvg_handle_read_stream_sync(handle, NULL, NULL, NULL); +#if LIBRSVG_CHECK_VERSION (2, 46, 0) + // rsvg_handle_close is deprecated since version 2.46 and looks like even not required if used with rsvg_handle_new_from_file +#else + rsvg_handle_close(handle, NULL); +#endif g_object_unref(handle); } } bool cImageImporterSVG::LoadImage(const char *path) { if (handle) { - rsvg_handle_read_stream_sync(handle, NULL, NULL, NULL); +#if LIBRSVG_CHECK_VERSION (2, 46, 0) + // rsvg_handle_close is deprecated since version 2.46 and looks like even not required if used with rsvg_handle_new_from_file +#else + rsvg_handle_close(handle, NULL); +#endif g_object_unref(handle); } @@ -521,3 +529,5 @@ void cSVGTemplate::ReplaceTokens(string &line, size_t tokenStart, size_t tokenEn std::replace( svgAlpha.begin(), svgAlpha.end(), ',', '.'); line.replace(hitAlpha, hitAlphaEnd - hitAlpha + 2, svgAlpha); } + +// vim: ts=4 sw=4 et