Skip to content

Commit

Permalink
System: Fix crash toggling debug GPU device
Browse files Browse the repository at this point in the history
When postfx is enabled.
  • Loading branch information
stenzek committed Mar 24, 2024
1 parent c0e6750 commit 480c785
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,10 @@ bool System::RecreateGPU(GPURenderer renderer, bool force_recreate_device, bool
// create new renderer
g_gpu.reset();
if (force_recreate_device)
{
PostProcessing::Shutdown();
Host::ReleaseGPUDevice();
}

if (!CreateGPU(renderer, true))
{
Expand Down Expand Up @@ -2042,6 +2045,7 @@ bool System::CreateGPU(GPURenderer renderer, bool is_switching)
Log_ErrorPrintf("Failed to create fallback software renderer.");
if (!s_keep_gpu_device_on_shutdown)
{
PostProcessing::Shutdown();
Host::ReleaseGPUDevice();
Host::ReleaseRenderWindow();
}
Expand Down

0 comments on commit 480c785

Please sign in to comment.