fix memory leak in StreamingSoundQoa.Create

pull/49/head
cosmonaut 2023-05-11 19:45:07 -07:00
parent c037b4cb69
commit 76684eaa33
1 changed files with 5 additions and 1 deletions

View File

@ -26,7 +26,7 @@ namespace MoonWorks.Audio
FAudio.qoa_attributes(handle, out var channels, out var samplerate, out var samplesPerChannelPerFrame, out var totalSamplesPerChannel);
return new StreamingSoundQoa(
var streamingSound = new StreamingSoundQoa(
device,
filePath,
channels,
@ -34,6 +34,10 @@ namespace MoonWorks.Audio
samplesPerChannelPerFrame,
totalSamplesPerChannel
);
FAudio.qoa_close(handle);
return streamingSound;
}
internal unsafe StreamingSoundQoa(