fix crash on swap chain resize
This commit is contained in:
@@ -52,7 +52,7 @@ internal class ImGuiHandler : IDisposable
|
|||||||
public void DoRender()
|
public void DoRender()
|
||||||
{
|
{
|
||||||
if (Rtv is null)
|
if (Rtv is null)
|
||||||
throw new InvalidOperationException("Rtv is null");
|
return;
|
||||||
|
|
||||||
ImGui_ImplDX11_NewFrame();
|
ImGui_ImplDX11_NewFrame();
|
||||||
ImGui_ImplWin32_NewFrame();
|
ImGui_ImplWin32_NewFrame();
|
||||||
|
@@ -82,4 +82,13 @@ public static class SwapChainPatch
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPrefix, HarmonyPatch(typeof(MyBackbuffer), nameof(MyBackbuffer.Release))]
|
||||||
|
private static void SwapChainBBReleasePrefix(MyBackbuffer __instance)
|
||||||
|
{
|
||||||
|
if (ImGuiHandler.Rtv is null) return;
|
||||||
|
|
||||||
|
ImGuiHandler.Rtv.Dispose();
|
||||||
|
ImGuiHandler.Rtv = null;
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user