I’m working on adding a main menu with a quit button. The OnClicked event simply does FGenericPlatformMisc::RequestExit(false);
.
I then get an exception from the engine. Specifically, EditorEngine.cpp, line 854.
void UEditorEngine::FinishDestroy()
{
if ( !HasAnyFlags(RF_ClassDefaultObject) )
{
// this needs to be already cleaned up
check(PlayWorld == NULL);
The final line is what’s triggering the exception. According to the watch, PlayWorld
and this
are both None, but have valid memory addresses:
+ this 0x000000001fe1ab00 (Name=0x00000000027d60d0 "None") UEditorEngine *
+ PlayWorld 0x000000004e7f3580 (Name=0x00000000027d60d0 "None") UWorld *
I believe this means they’ve been marked for deletion, but haven’t actually been deleted. Stacktrace is:
> UE4Editor-UnrealEd.dll!UEditorEngine::FinishDestroy() Line 854 C++
UE4Editor-CoreUObject.dll!UObject::ConditionalFinishDestroy() Line 685 C++
UE4Editor-CoreUObject.dll!IncrementalPurgeGarbage(bool bUseTimeLimit, float TimeLimit) Line 1019 C++
UE4Editor-CoreUObject.dll!StaticExit() Line 3718 C++
UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() Line 921 C++
UE4Editor.exe!TBaseMulticastDelegate<void>::Broadcast() Line 809 C++
UE4Editor.exe!FEngineLoop::AppPreExit() Line 2942 C++
UE4Editor.exe!FEngineLoop::Exit() Line 2203 C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 153 C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 189 C++
[External Code]
I have no idea if this is an issue specific to 4.9 or something wrong in my project, as I’ve only just now added the RequestExit(false) call. Pressing esc to get out of PIE works fine, with no issues. Is it possible that some oddity in my project is preventing the timely deletion of PlayWorld?