From 5608460901ba5e4cac9eafa64fb8e72d43c8351e Mon Sep 17 00:00:00 2001 From: rigidatoms Date: Fri, 24 Apr 2026 08:57:20 -0300 Subject: [PATCH] add missing UnloadFileData() (#5787) Adds missing function necessary for using the module as a standalone library. --- src/raudio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/raudio.c b/src/raudio.c index f05567cc8..b9c4eda05 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -434,6 +434,7 @@ static const char *GetFileName(const char *filePath); // Get point static const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) static unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read) +static void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() static bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write) static bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated #endif @@ -2882,6 +2883,12 @@ static unsigned char *LoadFileData(const char *fileName, int *dataSize) return data; } +// Unload file data allocated by LoadFileData() +void UnloadFileData(unsigned char *data) +{ + RL_FREE(data); +} + // Save data to file from buffer static bool SaveFileData(const char *fileName, void *data, int dataSize) {