mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Fixed com interface releasing and nullification
This commit is contained in:
@@ -40,8 +40,11 @@ namespace GlitchyEngine.Platform.DX11
|
|||||||
*/
|
*/
|
||||||
static void InitDevice()
|
static void InitDevice()
|
||||||
{
|
{
|
||||||
IUnknown.ReleaseAndNull!(ref Device);
|
Device?.Release();
|
||||||
IUnknown.ReleaseAndNull!(ref ImmediateContext);
|
Device = null;
|
||||||
|
|
||||||
|
ImmediateContext?.Release();
|
||||||
|
ImmediateContext = null;
|
||||||
|
|
||||||
Log.EngineLogger.Trace("Creating D3D11 Device and Context...");
|
Log.EngineLogger.Trace("Creating D3D11 Device and Context...");
|
||||||
|
|
||||||
@@ -123,13 +126,20 @@ namespace GlitchyEngine.Platform.DX11
|
|||||||
|
|
||||||
public static void Shutdown()
|
public static void Shutdown()
|
||||||
{
|
{
|
||||||
IUnknown.ReleaseAndNull!(ref Device);
|
Device?.Release();
|
||||||
IUnknown.ReleaseAndNull!(ref ImmediateContext);
|
Device = null;
|
||||||
|
|
||||||
IUnknown.ReleaseAndNull!(ref DxgiDevice);
|
ImmediateContext?.Release();
|
||||||
IUnknown.ReleaseAndNull!(ref SwapChain);
|
ImmediateContext = null;
|
||||||
|
|
||||||
|
DxgiDevice?.Release();
|
||||||
|
DxgiDevice = null;
|
||||||
|
|
||||||
IUnknown.ReleaseAndNull!(ref BackBufferTarget);
|
SwapChain?.Release();
|
||||||
|
SwapChain = null;
|
||||||
|
|
||||||
|
BackBufferTarget?.Release();
|
||||||
|
BackBufferTarget = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Present()
|
public static void Present()
|
||||||
|
|||||||
Reference in New Issue
Block a user