]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
sdl2: Fix CCode.destroy_function of SDL.RWops and usage of SDL.RWops.from_file()
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 4 Jun 2024 08:48:16 +0000 (10:48 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 4 Jun 2024 08:49:46 +0000 (10:49 +0200)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1550

vapi/sdl2.vapi

index c8040acfbf482ef518fb3f646e5a3f27f87422fe..da9296634bf0c62a6a0dc10bd791f14221e4b796 100644 (file)
@@ -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);
                }