Don't call rsvg_handle_close(); it's deprecated

Borrowing from 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/
This commit is contained in:
Bill Kendrick 2024-05-14 23:28:50 -07:00
parent ca537e2fbb
commit 79d5cb5cea
2 changed files with 11 additions and 6 deletions

View file

@ -80,6 +80,11 @@ https://tuxpaint.org/
(https://sourceforge.net/p/tuxpaint/tuxpaint/merge-requests/19/)
Will Thompson <https://sourceforge.net/u/wjjjjt/profile/>
* 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 <bill@newbreedsoftware.com>
* Documentation updates:
----------------------
* Troubleshooting Guide (TROUBLESHOOTING.txt) updated regarding

View file

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