Ignore:
Timestamp:
02/06/17 21:13:58 (8 years ago)
Author:
epyon
Message:
  • fixes in handle store
  • removal of get_handle
  • indices instead of handles
  • efficient handle store clears
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fmod/fmod_audio.cc

    r406 r543  
    107107{
    108108        sound_info* info = m_sounds.get( a_sound );
     109        release( info );
     110        m_sounds.destroy( a_sound );
     111}
     112
     113void nv::fmod::audio::release( sound_info* info )
     114{
    109115        if ( info )
    110         {
    111116                FMOD_Sound_Release( static_cast<FMOD_SOUND*>( info->fmod_sound ) );
    112                 m_sounds.destroy( a_sound );
    113         }
    114117}
    115118
     
    146149fmod::audio::~audio()
    147150{
    148         while ( m_sounds.size() > 0 )
    149                 release( m_sounds.get_handle(0) );
     151        for ( auto& s : m_sounds )
     152                release( &s );
     153        m_sounds.clear();
    150154        FMOD_System_Release( static_cast<FMOD_SYSTEM*>( m_system ) );
    151155}
Note: See TracChangeset for help on using the changeset viewer.