mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Fix] (...): Avoid some weird crashes.
This commit is contained in:
+11
-1
@@ -5,10 +5,13 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-only
|
||||
// End of Source File Header
|
||||
|
||||
#include "Includes.h"
|
||||
#include "Init.h"
|
||||
#include "Config.h"
|
||||
#include <MG_Impl/Init.h>
|
||||
#include <MG_Backend/Backends.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#include <MG_Impl/GLImpl/Texture/ProxyTexture.h>
|
||||
#include <MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.h>
|
||||
|
||||
namespace MobileGL {
|
||||
void MG_Initialize() {
|
||||
@@ -16,6 +19,7 @@ namespace MobileGL {
|
||||
MGLOG_I("Initializing MobileGL...");
|
||||
MG_State::Init();
|
||||
MGLOG_D("MobileGL State initialized");
|
||||
// return;
|
||||
MG_Backend::Init();
|
||||
MGLOG_D("MobileGL Backend initialized");
|
||||
MG_Impl::Init();
|
||||
@@ -28,7 +32,13 @@ namespace MobileGL {
|
||||
void MG_Destroy() {
|
||||
MGLOG_I("MobileGL closing...");
|
||||
glslang::FinalizeProcess();
|
||||
delete MG_State::pGLContext;
|
||||
MG_Config::RendererInfoPtr.reset();
|
||||
delete MG_Impl::GLImpl::TextureImpl::pProxyTextureManager;
|
||||
delete MG_Impl::GLImpl::FramebufferImpl::pDefaultFramebufferInfo;
|
||||
MG_Util::Debug::Close();
|
||||
|
||||
// TODO: add and use Destroy functions for other subsystems
|
||||
}
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
|
||||
Reference in New Issue
Block a user