Move stream_.state update to the end of wasapiThread()
authorMarcus Tomlinson <marcustomlinson@MacBook-Air.local>
Fri, 20 Apr 2018 16:37:02 +0000 (18:37 +0200)
committerMarcus Tomlinson <marcustomlinson@MacBook-Air.local>
Wed, 22 Aug 2018 08:29:12 +0000 (09:29 +0100)
RtAudio.cpp

index 36bebd406333c515a344761acf4daa0bc325b489..18e900e8fbc73402359c554f418b1a9fb9528b4a 100644 (file)
@@ -1,4 +1,4 @@
-/************************************************************************/
+/************************************************************************/
 /*! \class RtAudio
     \brief Realtime audio i/o C++ classes.
 
@@ -5366,13 +5366,11 @@ Exit:
 
   CoUninitialize();
 
+  if ( !errorText_.empty() )
+    error( errorType );
+
   // update stream state
   stream_.state = STREAM_STOPPED;
-
-  if ( errorText_.empty() )
-    return;
-  else
-    error( errorType );
 }
 
 //******************** End of __WINDOWS_WASAPI__ *********************//