Merge branch 'pbiering/fix-rsvg'

This commit is contained in:
kamel5 2021-03-23 15:57:20 +01:00
commit 894b5865cd

View File

@ -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