diff options
| author | Gary Scavone <gary@music.mcgill.ca> | 2011-08-14 13:45:27 +0000 |
|---|---|---|
| committer | Stephen Sinclair <sinclair@music.mcgill.ca> | 2013-10-11 01:38:28 +0200 |
| commit | 692c1b860c5ccc43420263f12a4d6a46f987b8a6 (patch) | |
| tree | 88c00c9f9a223f44c1951ae19d2c68b31db0a94c /RtAudio.cpp | |
| parent | c32410a961a1e54c1626822f54703cec54cee343 (diff) | |
Final update for release 4.0.9, including DS bugfix in getDeviceCount (gs).
Diffstat (limited to 'RtAudio.cpp')
| -rw-r--r-- | RtAudio.cpp | 9 |
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();
}
|
