I have made my own fix for this, but there are other ways it could be addressed:
- Modify `RHIExit()` in DynamicRHI.cpp so that `GDynamicRHI->Shutdown() and delete` is still called when using null rhi. My reasoning is that if it is initialized for nullrhi then it should be deinitialized for it also.
- Modify `FNullDynamicRHI::Shutdown()` to call `FRenderResource::ReleaseRHIForAllResources();` so it matches `FRenderResource::InitPreRHIResources();` call in `FNullDynamicRHI::Init()`
Steps to Reproduce
As per the attached example project (just run client with -nullrhi):
- New empty project
- Enable DX12 SM6 for Nanite support
- Ensure the client will exit itself, e.g.
- Select the `(project name)GameModeBase` as the default game mode
- Override `BeginPlay`
- Add `FPlatformMisc::RequestExitWithStatus(false, 0);` to `BeginPlay`
- Run client with `-nullrhi` command line argument
- Crash on exit will occur during static deinit of Nanite feedback system due to `GSystem` having already been destructed (i.e. static order of deinit bug).
Hello there,
I’ve replicated the issue, and this does indeed appear to be a bug.
I’ll file a bug report and reply with a tracking link when one becomes available.
Best regards,
Chris
Hi,
Please find the tracker live at Unreal Engine Issues and Bug Tracker (UE-266669). Thank you for bringing this to our attention.
Best regards,
Chris