summaryrefslogtreecommitdiff
path: root/RtAudio.cpp
diff options
context:
space:
mode:
authorGary Scavone <gary@music.mcgill.ca>2011-08-14 13:45:27 +0000
committerStephen Sinclair <sinclair@music.mcgill.ca>2013-10-11 01:38:28 +0200
commit692c1b860c5ccc43420263f12a4d6a46f987b8a6 (patch)
tree88c00c9f9a223f44c1951ae19d2c68b31db0a94c /RtAudio.cpp
parentc32410a961a1e54c1626822f54703cec54cee343 (diff)
Final update for release 4.0.9, including DS bugfix in getDeviceCount (gs).
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 ab50cbb..4a3966b 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -3661,9 +3661,12 @@ unsigned int RtApiDs :: getDeviceCount( void )
}
// Clean out any devices that may have disappeared.
- std::vector< DsDevice > :: iterator it;
- for ( it=dsDevices.begin(); it < dsDevices.end(); it++ )
- if ( it->found == false ) dsDevices.erase( it );
+ std::vector< int > indices;
+ for ( unsigned int i=0; i<dsDevices.size(); i++ )
+ if ( dsDevices[i].found == false ) indices.push_back( i );
+ for ( unsigned int nErased=0, unsigned int i=0; i<indices.size(); i++, nErased++ ) {
+ dsDevices.erase( dsDevices.begin()-nErased );
+ }
return dsDevices.size();
}