Skip to content

[raudio] UnloadSound doesn't actually unload the Sound file and causes a memory leak. #3123

@volke0

Description

@volke0

Hi,

I found that loading a sound file via LoadSound() and then sub-sequentially using UnloadSound() doesn't unload the sound data from memory and causes a memory leak. I found this via Visual Studio 2019 on the memory monitor using Raylib 4.5 in C++.

This is pretty straightforward to reproduce:
First, simply load a sound file with LoadSound() into a Sound variable, e.g. Sound sfx = LoadSound(file_path.c_str()); .
Then use UnloadSound on sfx and loop the process and see the memory usage skyrocket.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions