Description

See the UDN question (duplicated below). I think we need to better manage the lifetime of the event we use for synchronization here.

 

We are experiencing an issue where when FPlatformMisc::RequestExit or any other function that exits the app is called, render thread waits indefinitely for FrameReadyEvent in FMetalDeviceContext::EndDrawingViewport. FrameReadyEvent is not fired because since FPlatformMisc::RequestExit has been called, IsEngineExitRequested() returns true and FIOSFramePacer::signal function (IOSPlatformFramePacer.cpp) returns prematurely before reaching the event firing logic (at line 118).

Simply changing ListeningEvents to always fire solves the issue for now (like in the following snippet) but what would be the proper way to handle it? 

 

// during shutdown, this can cause crashes (only non-backgrounding apps do this)
if (IsEngineExitRequested())
{
  for( auto& NextEvent : ListeningEvents )
  {
    NextEvent->Trigger();
  } return;
};

 

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-159215 in the post.

2
Login to Vote

Unresolved
ComponentUE - Platform - Apple
Affects Versions4.27
Target Fix5.5
CreatedJul 12, 2022
UpdatedFeb 29, 2024