[Fix] (...): Avoid some weird crashes.

This commit is contained in:
BZLZHH
2026-01-01 00:41:23 +08:00
parent 7c2380ccce
commit ee4dc70336
10 changed files with 173 additions and 154 deletions
+11 -1
View File
@@ -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__)