Fixed crash on stop. Was destroying the device and not the renderer.
This commit is contained in:
@@ -198,6 +198,28 @@ namespace Juliet
|
||||
|
||||
void DestroyRenderer_Internal(NonNullPtr<D3D12Renderer> renderer)
|
||||
{
|
||||
if (renderer->IndirectDrawCommandSignature)
|
||||
{
|
||||
ID3D12CommandSignature_Release(renderer->IndirectDrawCommandSignature);
|
||||
renderer->IndirectDrawCommandSignature = nullptr;
|
||||
}
|
||||
if (renderer->IndirectIndexedDrawCommandSignature)
|
||||
{
|
||||
ID3D12CommandSignature_Release(renderer->IndirectIndexedDrawCommandSignature);
|
||||
renderer->IndirectIndexedDrawCommandSignature = nullptr;
|
||||
}
|
||||
if (renderer->IndirectDispatchCommandSignature)
|
||||
{
|
||||
ID3D12CommandSignature_Release(renderer->IndirectDispatchCommandSignature);
|
||||
renderer->IndirectDispatchCommandSignature = nullptr;
|
||||
}
|
||||
|
||||
if (renderer->CommandQueue)
|
||||
{
|
||||
ID3D12CommandQueue_Release(renderer->CommandQueue);
|
||||
renderer->CommandQueue = nullptr;
|
||||
}
|
||||
|
||||
if (renderer->D3D12Device)
|
||||
{
|
||||
ID3D12Device_Release(renderer->D3D12Device);
|
||||
@@ -231,7 +253,7 @@ namespace Juliet
|
||||
|
||||
void DestroyGraphicsDevice(NonNullPtr<GraphicsDevice> device)
|
||||
{
|
||||
auto* renderer = reinterpret_cast<D3D12Renderer*>(device.Get());
|
||||
auto* renderer = reinterpret_cast<D3D12Renderer*>(device->Renderer);
|
||||
DestroyRenderer_Internal(renderer);
|
||||
Free(device.Get());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user