aboutsummaryrefslogtreecommitdiffstats
path: root/RtAudio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'RtAudio.cpp')
-rw-r--r--RtAudio.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index 4a3966b..ecea3ea 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -3662,10 +3662,14 @@ unsigned int RtApiDs :: getDeviceCount( void )
// Clean out any devices that may have disappeared.
std::vector< int > indices;
- for ( unsigned int i=0; i<dsDevices.size(); i++ )
+ 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 );
+ }
+
+ unsigned int nErased=0;
+ for (unsigned int i=0; i<indices.size(); i++ ) {
+ dsDevices.erase( dsDevices.begin()-nErased );
+ nErased++;
}
return dsDevices.size();