Final update for release 4.0.9, including DS bugfix in getDeviceCount (gs).
authorGary Scavone <gary@music.mcgill.ca>
Sun, 14 Aug 2011 13:45:27 +0000 (13:45 +0000)
committerStephen Sinclair <sinclair@music.mcgill.ca>
Thu, 10 Oct 2013 23:38:28 +0000 (01:38 +0200)
RtAudio.cpp
doc/doxygen/tutorial.txt
doc/release.txt

index ab50cbb36d2a1d8020c70a8956013247a98d979f..4a3966b5700ba3e16caa1a5897e41bde199a3dcf 100644 (file)
@@ -3661,9 +3661,12 @@ unsigned int RtApiDs :: getDeviceCount( void )
   }\r
 \r
   // Clean out any devices that may have disappeared.\r
-  std::vector< DsDevice > :: iterator it;\r
-  for ( it=dsDevices.begin(); it < dsDevices.end(); it++ )\r
-    if ( it->found == false ) dsDevices.erase( it );\r
+  std::vector< int > indices;\r
+  for ( unsigned int i=0; i<dsDevices.size(); i++ )\r
+    if ( dsDevices[i].found == false ) indices.push_back( i );\r
+  for ( unsigned int nErased=0, unsigned int i=0; i<indices.size(); i++, nErased++ ) {\r
+    dsDevices.erase( dsDevices.begin()-nErased );\r
+  }\r
 \r
   return dsDevices.size();\r
 }\r
index 3ed7a9e11e1d0254fa226da84c58e245be0f9bf3..1066f41028fef516d20b6810d98934e054f7b596 100644 (file)
@@ -32,7 +32,7 @@ Devices are now re-enumerated every time the RtAudio::getDeviceCount(), RtAudio:
 
 \section download Download
 
-Latest Release (11 August 2011): <A href="http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.9.tar.gz">Version 4.0.9</A>
+Latest Release (14 August 2011): <A href="http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.9.tar.gz">Version 4.0.9</A>
 
 \section documentation Documentation Links
 
index c58c9d91529a495691be604b7bc3ea970fa99cb5..ebbc4322cc32c73d22cbe1fe19f1922c395f4128 100644 (file)
@@ -2,12 +2,13 @@ RtAudio - a set of C++ classes that provide a common API for realtime audio inpu
 
 By Gary P. Scavone, 2001-2011.
 
-v4.0.9: (11 August 2011)
+v4.0.9: (14 August 2011)
 - fix for ASIO problem enumerating devices after opening duplex stream (Oliver Larkin)
 - fix for OS-X problems setting sample rate and bits-per-sample
 - updates for OS-X "Lion"
 - updates for wide character support in Windows DS (UNICODE)
 - fix for possible ALSA callback thread hang (thanks to Tristan Matthews)
+- fix for DS getDeviceCount bug (vector erase problem)
 
 v4.0.8: (12 April 2011)
 - fix for MinGW4 problem enumerating and setting sample rates (iasiothiscallresolver, Dmitry Kostjuchenko)