Changeset 414

Show
Ignore:
Timestamp:
08/29/08 00:53:11 (4 months ago)
Author:
gabriel
Message:

Moved up lock on stopping audio drivers. Was segfaulting in Sampler and Note.

On exit, Hydrogen would sometimes segfault with one of the following:

hydrogen: libs/hydrogen/src/sampler/sampler.cpp:91: void H2Core::Sampler::process(uint32_t, H2Core::Song*): Assertion `audio_output' failed.

hydrogen: libs/hydrogen/src/note.cpp:107: void H2Core::Note::set_instrument(H2Core::Instrument*): Assertion `instrument->get_adsr()' failed.

This could sometimes be forced by playing a lot of notes and exiting
while playing (note.cpp), but the assert in sampler.cpp would happen
under any circumstances.

Backported from jackMidi branch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libs/hydrogen/src/hydrogen.cpp

    r381 r414  
    15551555        _INFOLOG( "[audioEngine_stopAudioDrivers]" ); 
    15561556 
     1557        AudioEngine::get_instance()->lock( "audioEngine_stopAudioDrivers" ); 
     1558 
    15571559        // check current state 
    15581560        if ( m_audioEngineState == STATE_PLAYING ) { 
     
    15821584 
    15831585 
    1584         AudioEngine::get_instance()->lock( "audioEngine_stopAudioDrivers" ); 
    15851586        // change the current audio engine state 
    15861587        m_audioEngineState = STATE_INITIALIZED;