diff options
| author | Lioncash <mathew1800@gmail.com> | 2015-12-20 21:49:49 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2015-12-20 22:40:37 -0500 |
| commit | f2951828335654d0993ead998b3c547f903501dd (patch) | |
| tree | acf56e852bc06711f07382821f9d115fea060b00 /Source/Core/VideoCommon/RenderBase.cpp | |
| parent | 1fbab188adafaf46e252837153cbfa3242a8d3c7 (diff) | |
VideoBackends: Simplify initialization and deinitialization of resources
Approximately three or four times now, the issue of pointers being
in an inconsistent state been an issue in the video backend renderers
with regards to tripping up other developers.
Global (ugh) resources are put into a unique_ptr and will always have a
well-defined state of being - null or not null
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 89bfa4dce1..40b6dd5bae 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -14,6 +14,7 @@ #include <cinttypes> #include <cmath> +#include <memory> #include <string> #include "Common/Atomic.h" @@ -51,7 +52,7 @@ int frameCount; int OSDChoice; static int OSDTime; -Renderer *g_renderer = nullptr; +std::unique_ptr<Renderer> g_renderer; std::mutex Renderer::s_criticalScreenshot; std::string Renderer::s_sScreenshotName; |
