Skip to content

Commit 5608460

Browse files
authored
add missing UnloadFileData() (#5787)
Adds missing function necessary for using the module as a standalone library.
1 parent 3b23200 commit 5608460

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/raudio.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ static const char *GetFileName(const char *filePath); // Get point
434434
static const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
435435

436436
static unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read)
437+
static void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
437438
static bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write)
438439
static bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated
439440
#endif
@@ -2882,6 +2883,12 @@ static unsigned char *LoadFileData(const char *fileName, int *dataSize)
28822883
return data;
28832884
}
28842885

2886+
// Unload file data allocated by LoadFileData()
2887+
void UnloadFileData(unsigned char *data)
2888+
{
2889+
RL_FREE(data);
2890+
}
2891+
28852892
// Save data to file from buffer
28862893
static bool SaveFileData(const char *fileName, void *data, int dataSize)
28872894
{

0 commit comments

Comments
 (0)