From 154e121e500dc2e9f6e6277db5b4f35c4222a216 Mon Sep 17 00:00:00 2001 From: Gary Scavone Date: Sat, 26 Apr 2014 08:44:43 -0400 Subject: Wasap bug(?) fix in destructor; Update to record.cpp for default device selection. --- RtAudio.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'RtAudio.cpp') diff --git a/RtAudio.cpp b/RtAudio.cpp index 039b5d0..a31a54b 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -3850,7 +3850,6 @@ RtApiWasapi::RtApiWasapi() { // WASAPI can run either apartment or multi-threaded HRESULT hr = CoInitialize( NULL ); - if ( !FAILED( hr ) ) coInitialized_ = true; @@ -3869,16 +3868,14 @@ RtApiWasapi::RtApiWasapi() RtApiWasapi::~RtApiWasapi() { - // if this object previously called CoInitialize() - if ( coInitialized_ ) { - CoUninitialize(); - } - - if ( stream_.state != STREAM_CLOSED ) { + if ( stream_.state != STREAM_CLOSED ) closeStream(); - } SAFE_RELEASE( deviceEnumerator_ ); + + // If this object previously called CoInitialize() + if ( coInitialized_ ) + CoUninitialize(); } //============================================================================= @@ -5095,7 +5092,6 @@ Exit: CoTaskMemFree( captureFormat ); CoTaskMemFree( renderFormat ); - //delete convBuffer; free ( convBuffer ); CoUninitialize(); -- cgit v1.2.3