Files
UnrealEngineUWP/Engine/Source/Runtime/Slate
paul chipchase f2375e67d0 Fixed a crash when running the -AutomatedMapBuild command line with the editor due to windows not being properly closed.
#jira UE-78213
#rb Matt.Kuhlenschmidt

While running the -AutomatedMapBuild command, several windows will be created (such as the notification window panel) which then rely on the method FSlateApplication::CloseAllWindowsImmediately to close them properly. If the windows are not closed properly we ended up receiving messages from these windows after FWindowsApplication had been deleted, which meant that the message proc could access the now deleted members of FWindowsApplication and crash.

The reason why ::CloseAllWindowsImmediately could fail was the loop that iterated over all of the top level windows was not taking into account that the call to destroy the window (::RequestDestroyWindow) would also remove that window from the array of top level windows, meaning we would skip every other window.

To fix it we now iterate over the array in reverse order so that ever window gets hit (although this relies on ::RequestDestroyWindow destroying a single window each time it is called)

#ROBOMERGE-SOURCE: CL 7785304 in //UE4/Release-4.23/...
#ROBOMERGE-BOT: RELEASE (Release-4.23 -> Main) (v386-7774470)

[CL 7785305 by paul chipchase in Main branch]
2019-08-06 03:00:25 -04:00
..