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?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-159215 in the post.