From 98c170f8298f8ff2947fc0a1f7677cd05030dbab Mon Sep 17 00:00:00 2001 From: Conn O'Griofa Date: Thu, 14 Sep 2017 07:20:46 +0100 Subject: [PATCH] AudioManager: don't initialize when unnecessary If navigation sounds are disabled, don't initialize AudioManager unnecessarily. --- es-core/src/AudioManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/es-core/src/AudioManager.cpp b/es-core/src/AudioManager.cpp index e4e3dce12..735099bc8 100644 --- a/es-core/src/AudioManager.cpp +++ b/es-core/src/AudioManager.cpp @@ -1,4 +1,5 @@ #include "AudioManager.h" +#include "Settings.h" #include #include "Log.h" @@ -62,7 +63,7 @@ AudioManager::~AudioManager() std::shared_ptr & AudioManager::getInstance() { //check if an AudioManager instance is already created, if not create one - if (sInstance == nullptr) { + if (sInstance == nullptr && Settings::getInstance()->getBool("EnableSounds")) { sInstance = std::shared_ptr(new AudioManager); } return sInstance;