From 79d5cb5cea992d22c4e6ed0e8fbb611a4b0d297f Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Tue, 14 May 2024 23:28:50 -0700 Subject: [PATCH] Don't call rsvg_handle_close(); it's deprecated Borrowing from https://github.com/xfce-mirror/xfce4-xkb-plugin/commit/825fa1c, - rsvg_handle_close() is deprecated from librsvg 2.46, together with rsvg_handle_write() - rsvg_handle_close() is only needed to be called after rsvg_handle_write() - rsvg_handle_close() isn't needed to be called after rsvg_handle_new_from_file() [1] 1: https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/method.Handle.close.html Shrug! Closes https://sourceforge.net/p/tuxpaint/bugs/278/ --- docs/CHANGES.txt | 5 +++++ src/tuxpaint.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 644a99275..622a7c683 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -80,6 +80,11 @@ https://tuxpaint.org/ (https://sourceforge.net/p/tuxpaint/tuxpaint/merge-requests/19/) Will Thompson + * Don't call rsvg_handle_close(); it's deprecated, and not necessary; + (see https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/method.Handle.close.html; + h/t https://github.com/xfce-mirror/xfce4-xkb-plugin/commit/825fa1c + Bill Kendrick + * Documentation updates: ---------------------- * Troubleshooting Guide (TROUBLESHOOTING.txt) updated regarding diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 2fec81bf8..c203ce370 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -21213,7 +21213,7 @@ static SDL_Surface *_load_svg(const char *file) if (image == NULL) { fprintf(stderr, "Unable to allocate image buffer for %s\n", file); - rsvg_handle_close(rsvg_handle, &gerr); + // rsvg_handle_close(rsvg_handle, &gerr); Not needed return (NULL); } @@ -21227,7 +21227,7 @@ static SDL_Surface *_load_svg(const char *file) #ifdef DEBUG fprintf(stderr, "cairo_image_surface_create() failed\n"); #endif - rsvg_handle_close(rsvg_handle, &gerr); + // rsvg_handle_close(rsvg_handle, &gerr); Not needed free(image); return (NULL); } @@ -21241,7 +21241,7 @@ static SDL_Surface *_load_svg(const char *file) #ifdef DEBUG fprintf(stderr, "cairo_create() failed\n"); #endif - rsvg_handle_close(rsvg_handle, &gerr); + // rsvg_handle_close(rsvg_handle, &gerr); Not needed cairo_surface_destroy(cairo_surf); free(image); return (NULL); @@ -21288,7 +21288,7 @@ static SDL_Surface *_load_svg(const char *file) #ifdef DEBUG fprintf(stderr, "SDL_CreateRGBSurfaceFrom() failed\n"); #endif - rsvg_handle_close(rsvg_handle, &gerr); + // rsvg_handle_close(rsvg_handle, &gerr); Not needed cairo_surface_destroy(cairo_surf); free(image); cairo_destroy(cr); @@ -21304,7 +21304,7 @@ static SDL_Surface *_load_svg(const char *file) #ifdef DEBUG fprintf(stderr, "SDL_DisplayFormatAlpha() failed\n"); #endif - rsvg_handle_close(rsvg_handle, &gerr); + // rsvg_handle_close(rsvg_handle, &gerr); Not needed cairo_surface_destroy(cairo_surf); free(image); cairo_destroy(cr); @@ -21317,7 +21317,7 @@ static SDL_Surface *_load_svg(const char *file) /* Clean up: */ - rsvg_handle_close(rsvg_handle, &gerr); + // rsvg_handle_close(rsvg_handle, &gerr); Not needed cairo_surface_destroy(cairo_surf); free(image); cairo_destroy(cr);