Skip to content

Commit

Permalink
Use static initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
sakertooth committed Feb 3, 2025
1 parent 09fa666 commit fcd8c4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/Sid/SidInstrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ SidInstrument::SidInstrument( InstrumentTrack * _instrument_track ) :
m_volumeModel( 15.0f, 0.0f, 15.0f, 1.0f, this, tr( "Volume" ) ),
m_chipModel( static_cast<int>(ChipModel::MOS8580), 0, NumChipModels-1, this, tr( "Chip model" ) )
{
// A Filter object needs to be created only once to do some static initialization and avoid
// dropouts down the line when we have to play a note for the first time.
static auto s_init = std::once_flag{};
std::call_once(s_init, [] { reSID::Filter{}; });
// A Filter object needs to be created only once to do some initialization, avoiding
// dropouts down the line when we have to play a note for the first time.
[[maybe_unused]] static auto s_filter = reSID::Filter{};

for( int i = 0; i < 3; ++i )
{
m_voice[i] = new VoiceObject( this, i );
Expand Down

0 comments on commit fcd8c4e

Please sign in to comment.