mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00:00
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
This commit is contained in:
parent
1fbab188ad
commit
f295182833
25 changed files with 104 additions and 86 deletions
|
@ -2,6 +2,8 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Common/GL/GLInterfaceBase.h"
|
||||
#include "Common/GL/GLUtil.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
@ -25,10 +27,9 @@ void SWOGLWindow::Init(void *window_handle)
|
|||
void SWOGLWindow::Shutdown()
|
||||
{
|
||||
GLInterface->Shutdown();
|
||||
delete GLInterface;
|
||||
GLInterface = nullptr;
|
||||
GLInterface.reset();
|
||||
|
||||
SWOGLWindow::s_instance.release();
|
||||
s_instance.reset();
|
||||
}
|
||||
|
||||
void SWOGLWindow::Prepare()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue