PlaySound has a Memory Leak when called

Shirley 21 Reputation points

I have a demo project where I first call

PlaySound (L "High_A. wav", NULL, SND_ASYNC | SND_LOOP);

to play the audio in a loop, and then call

PlaySound (NULL, NULL, NULL) to stop playing.

When I call PlaySound(L "High_A.wav", NULL, SND_ASYNC | SND_LOOP) again. And I found that the Memory (active private working set) and Page faults of audiodg. exe had both increased in the task manager.

After repeating the above operation multiple times, the Memory (active private working set) of audiodg. exe slowly increased and could not be released. Page faults always increase and no release.

Why? Am I using it incorrectly?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,219 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,171 questions
{count} votes