From 781cba14b1402e8968f85aed84d73f6fc4ea48ba Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 4 Jun 2024 10:48:16 +0200 Subject: [PATCH] sdl2: Fix CCode.destroy_function of SDL.RWops and usage of SDL.RWops.from_file() Fixes https://gitlab.gnome.org/GNOME/vala/issues/1550 --- vapi/sdl2.vapi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vapi/sdl2.vapi b/vapi/sdl2.vapi index c8040acfb..da9296634 100644 --- a/vapi/sdl2.vapi +++ b/vapi/sdl2.vapi @@ -1548,7 +1548,7 @@ namespace SDL { SET, CUR, END }// RWFlags - [CCode (cname = "SDL_RWops", free_function = "SDL_FreeRW", cheader_filename = "SDL2/SDL_rwops.h")] + [CCode (cname = "SDL_RWops", free_function = "SDL_RWclose", cheader_filename = "SDL2/SDL_rwops.h")] [Compact] public class RWops { @@ -2300,7 +2300,7 @@ namespace SDL { public int save_bmp_rw (RWops dst, int freedst = 0); public int save_bmp (string file) { - return save_bmp_rw (new SDL.RWops.from_file (file, "wb"), 1); + return save_bmp_rw (new SDL.RWops.from_file (file, "wb")); } [CCode (cname = "SDL_SetSurfaceRLE")] @@ -4377,7 +4377,7 @@ namespace SDL { public static unowned AudioSpec? load_rw (RWops src, int freesrc, ref AudioSpec spec, [CCode (array_length = false)] out uint8[] audio_buf, out uint32 audio_len); public static unowned AudioSpec? load (string file, ref AudioSpec spec, out uint8[] audio_buf, out uint32 audio_len) { - return load_rw (new SDL.RWops.from_file (file, "rb"), 1, + return load_rw (new SDL.RWops.from_file (file, "rb"), 0, ref spec, out audio_buf, out audio_len); } -- 2.47.2