mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-27 13:14:01 +08:00
Don't free objects with shutdown
Some games don't like to free the DX objects after the game has shut down.
This commit is contained in:
parent
4db2b6528c
commit
42a22dd4bb
@ -194,7 +194,17 @@ DX10_Hook::~DX10_Hook()
|
|||||||
{
|
{
|
||||||
PRINT_DEBUG("DX10 Hook removed\n");
|
PRINT_DEBUG("DX10 Hook removed\n");
|
||||||
|
|
||||||
resetRenderState();
|
if (initialized)
|
||||||
|
{
|
||||||
|
mainRenderTargetView->Release();
|
||||||
|
|
||||||
|
//ImGui_ImplDX10_Shutdown();
|
||||||
|
ImGui_ImplDX10_InvalidateDeviceObjects();
|
||||||
|
Windows_Hook::Inst().resetRenderState();
|
||||||
|
ImGui::DestroyContext();
|
||||||
|
|
||||||
|
initialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
FreeLibrary(reinterpret_cast<HMODULE>(_library));
|
FreeLibrary(reinterpret_cast<HMODULE>(_library));
|
||||||
|
|
||||||
|
@ -212,7 +212,18 @@ DX11_Hook::~DX11_Hook()
|
|||||||
{
|
{
|
||||||
PRINT_DEBUG("DX11 Hook removed\n");
|
PRINT_DEBUG("DX11 Hook removed\n");
|
||||||
|
|
||||||
resetRenderState();
|
if (initialized)
|
||||||
|
{
|
||||||
|
mainRenderTargetView->Release();
|
||||||
|
pContext->Release();
|
||||||
|
|
||||||
|
//ImGui_ImplDX11_Shutdown();
|
||||||
|
ImGui_ImplDX11_InvalidateDeviceObjects();
|
||||||
|
Windows_Hook::Inst().resetRenderState();
|
||||||
|
ImGui::DestroyContext();
|
||||||
|
|
||||||
|
initialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
FreeLibrary(reinterpret_cast<HMODULE>(_library));
|
FreeLibrary(reinterpret_cast<HMODULE>(_library));
|
||||||
|
|
||||||
|
@ -243,7 +243,19 @@ DX12_Hook::~DX12_Hook()
|
|||||||
{
|
{
|
||||||
PRINT_DEBUG("DX12 Hook removed\n");
|
PRINT_DEBUG("DX12 Hook removed\n");
|
||||||
|
|
||||||
resetRenderState();
|
if (initialized)
|
||||||
|
{
|
||||||
|
pCmdAlloc->Release();
|
||||||
|
pCmdList->Release();
|
||||||
|
pDescriptorHeap->Release();
|
||||||
|
|
||||||
|
//ImGui_ImplDX12_Shutdown();
|
||||||
|
ImGui_ImplDX12_InvalidateDeviceObjects();
|
||||||
|
Windows_Hook::Inst().resetRenderState();
|
||||||
|
ImGui::DestroyContext();
|
||||||
|
|
||||||
|
initialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
FreeLibrary(reinterpret_cast<HMODULE>(_library));
|
FreeLibrary(reinterpret_cast<HMODULE>(_library));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user