mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 12:44:16 +01:00
fix: null ref when ResizeBuffer() call before scene is init
thanks perch
This commit is contained in:
parent
617b0ee889
commit
c22ea31ac6
1 changed files with 3 additions and 1 deletions
|
|
@ -382,11 +382,13 @@ namespace Dalamud.Interface
|
||||||
|
|
||||||
private IntPtr ResizeBuffersDetour(IntPtr swapChain, uint bufferCount, uint width, uint height, uint newFormat, uint swapChainFlags)
|
private IntPtr ResizeBuffersDetour(IntPtr swapChain, uint bufferCount, uint width, uint height, uint newFormat, uint swapChainFlags)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
Log.Verbose($"Calling resizebuffers swap@{swapChain.ToInt64():X}{bufferCount} {width} {height} {newFormat} {swapChainFlags}");
|
Log.Verbose($"Calling resizebuffers swap@{swapChain.ToInt64():X}{bufferCount} {width} {height} {newFormat} {swapChainFlags}");
|
||||||
|
#endif
|
||||||
|
|
||||||
// We have to ensure we're working with the main swapchain,
|
// We have to ensure we're working with the main swapchain,
|
||||||
// as viewports might be resizing as well
|
// as viewports might be resizing as well
|
||||||
if (swapChain != this.scene.SwapChain.NativePointer)
|
if (this.scene == null || swapChain != this.scene.SwapChain.NativePointer)
|
||||||
return resizeBuffersHook.Original(swapChain, bufferCount, width, height, newFormat, swapChainFlags);
|
return resizeBuffersHook.Original(swapChain, bufferCount, width, height, newFormat, swapChainFlags);
|
||||||
|
|
||||||
this.scene?.OnPreResize();
|
this.scene?.OnPreResize();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue