From: Rico Tzschichholz Date: Tue, 4 Jun 2024 08:48:16 +0000 (+0200) Subject: sdl2: Fix CCode.destroy_function of SDL.RWops and usage of SDL.RWops.from_file() X-Git-Tag: 0.56.18~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dcaf49b68ef9de8b420f36fe562f297810604b3;p=thirdparty%2Fvala.git sdl2: Fix CCode.destroy_function of SDL.RWops and usage of SDL.RWops.from_file() Fixes https://gitlab.gnome.org/GNOME/vala/issues/1550 --- diff --git a/vapi/sdl2.vapi b/vapi/sdl2.vapi index d0a01095d..c6863da7c 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")] @@ -4386,7 +4386,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); }