summaryrefslogtreecommitdiff
path: root/RtAudio.cpp
diff options
context:
space:
mode:
authorgaryscavone <garyscavone@users.noreply.github.com>2023-01-08 10:45:20 -0800
committerGitHub <noreply@github.com>2023-01-08 10:45:20 -0800
commit2aa4b644c0ff7031c7d0b3c278f33cb63503d4f1 (patch)
tree60342a9be9e1ee0d0f08f503849ab7ff060d937d /RtAudio.cpp
parent91b599b2ede293ed100d677016ff8774d4437efc (diff)
parent9a40bc945b416dfda6615918255d7fdedaa0b9b0 (diff)
Merge pull request #384 from mvshyvk/fix/wasapi_interface_leaking
Fixed leaking of WASAPI IAudioClient3 interface
Diffstat (limited to 'RtAudio.cpp')
-rw-r--r--RtAudio.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index af8b63c..a51c100 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -4356,6 +4356,7 @@ MIDL_INTERFACE( "00000000-0000-0000-0000-000000000000" ) IAudioClient3
{
virtual HRESULT GetSharedModeEnginePeriod( WAVEFORMATEX*, UINT32*, UINT32*, UINT32*, UINT32* ) = 0;
virtual HRESULT InitializeSharedAudioStream( DWORD, UINT32, WAVEFORMATEX*, LPCGUID ) = 0;
+ virtual HRESULT Release() = 0;
};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL( IAudioClient3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
@@ -5209,12 +5210,12 @@ void RtApiWasapi::closeStream( void )
}
// clean up stream memory
+ SAFE_RELEASE(((WasapiHandle*)stream_.apiHandle)->captureClient)
+ SAFE_RELEASE(((WasapiHandle*)stream_.apiHandle)->renderClient)
+
SAFE_RELEASE( ( ( WasapiHandle* ) stream_.apiHandle )->captureAudioClient )
SAFE_RELEASE( ( ( WasapiHandle* ) stream_.apiHandle )->renderAudioClient )
- SAFE_RELEASE( ( ( WasapiHandle* ) stream_.apiHandle )->captureClient )
- SAFE_RELEASE( ( ( WasapiHandle* ) stream_.apiHandle )->renderClient )
-
if ( ( ( WasapiHandle* ) stream_.apiHandle )->captureEvent )
CloseHandle( ( ( WasapiHandle* ) stream_.apiHandle )->captureEvent );
@@ -5666,6 +5667,7 @@ void RtApiWasapi::wasapiThread()
MinPeriodInFrames,
captureFormat,
NULL );
+ SAFE_RELEASE(captureAudioClient3);
}
else
{
@@ -5777,6 +5779,7 @@ void RtApiWasapi::wasapiThread()
MinPeriodInFrames,
renderFormat,
NULL );
+ SAFE_RELEASE(renderAudioClient3);
}
else
{