Skip to content

Commit 8619c2d

Browse files
committed
Do not duplicate AudioManager::init/deinit
1 parent 2acbcc2 commit 8619c2d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

es-core/src/AudioManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ std::shared_ptr<AudioManager> & AudioManager::getInstance()
7272

7373
void AudioManager::init()
7474
{
75+
if(sInstance)
76+
return;
77+
7578
if (SDL_InitSubSystem(SDL_INIT_AUDIO) != 0)
7679
{
7780
LOG(LogError) << "Error initializing SDL audio!\n" << SDL_GetError();
@@ -103,6 +106,9 @@ void AudioManager::init()
103106

104107
void AudioManager::deinit()
105108
{
109+
if(!sInstance)
110+
return;
111+
106112
//stop all playback
107113
stop();
108114
//completely tear down SDL audio. else SDL hogs audio resources and emulators might fail to start...

0 commit comments

Comments
 (0)