After upgrading to UE 5.7.1 and DLSS 8.4.0 we are getting a crash shutting down the game on PC in StreamLine code because UStreamlineLibraryReflex::QueryReflexSupport can inadvertently construct FStreamlineLatencyMarkers::StreamlineLatencyMarkers (that is static) and never destruct it if "r.Streamline.InitializePlugin” is false, so the game crashes during static destruction phase due to the mutexes used by FTickableGameObject being already destroyed.
This can happen if another Plugin implements ILatencyMarkerModule (i.e.: XeSS) because the code in UStreamlineLibraryReflex::QueryReflexSupport calls GetStreamlineReflexLatencyMarkerModule that in turn lazily initializes FStreamlineLatencyMarkers::StreamlineLatencyMarkers.
Similarly would happen if something implements IMaxTickRateHandlerModule with FStreamlineMaxTickRateHandler::StreamlineMaxTickRateHandler
It should replicate by just enabling Intel’s XeSS 2.3.0 at the same time as DLSS 8.4.0 in UE 5.7.1 and running with r.Streamline.InitializePlugin false. The crash happens on shutdown on PC.
This is our fix:
void FStreamlineCoreModule::ShutdownModule()
{
auto CVarInitializePlugin = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Streamline.InitializePlugin"));
if (CVarInitializePlugin && !CVarInitializePlugin->GetBool())
{
// BEGIN - dmerayo - [DIVERGENCE] - Make sure that statics are destroyed to prevent crash due to potential initialization in QueryStreamlineSupport
FStreamlineMaxTickRateHandler::Reset();
FStreamlineLatencyMarkers::Reset();
// END
return;
}