VideoCommon: Get rid of the global g_available_video_backends

Replace it with a function-local static that is initialized on first
use. This gets rid of a global variable and removes the need for
manual initialization in UICommon.

This commit also replaces the weird find_if that looks for a non-null
unique_ptr with a simple "is vector empty" check considering that
none of the pointers can be null by construction.
This commit is contained in:
Léo Lam
2020-10-21 21:34:38 +02:00
parent fd5f9f4c26
commit aaaa3896c0
5 changed files with 39 additions and 39 deletions

View File

@ -97,7 +97,6 @@ void Init()
SConfig::Init();
Discord::Init();
Common::Log::LogManager::Init();
VideoBackendBase::PopulateList();
WiimoteReal::LoadSettings();
GCAdapter::Init();
VideoBackendBase::ActivateBackend(Config::Get(Config::MAIN_GFX_BACKEND));
@ -109,7 +108,6 @@ void Shutdown()
{
GCAdapter::Shutdown();
WiimoteReal::Shutdown();
VideoBackendBase::ClearList();
Common::Log::LogManager::Shutdown();
Discord::Shutdown();
SConfig::Shutdown();