Description

A licensee reported a crash happening when the engine shuts down. We determined it only occurred when invalidation panels are used, likely caused by a call to ClearChildren on a canvas panel in an invalidation panel.

Steps to Reproduce
  1. Create a new User Widget, let's call it WidgetA
  2. Add a new CanvasPanel to WidgetA inside its default "(Canvas Panel)" widget in the hierarchy, call it WidgetACanvas and check the IsVariable box
  3. Create another new User Widget called WidgetB
  4. In WidgetB, inside the default "(Canvas Panel)" widget add an Invalidation Box and, inside that, a text box (the text box may not be necessary but that's how I have it set up)
  5. Create a new blueprint HUD actor, i.e. a blueprint actor with AHUD as its parent class
  6. From the BeginPlay event, create an instance of WidgetA and WidgetB with the HUD's owning player controller as the Owning Player
  7. Call Add to Player Screen on WidgetA
  8. Call Add Child To Canvas on the WidgetA instance's WidgetACanvas, with WidgetB as the Content input
  9. Add an End Play event, and from there call Clear Children on WidgetACanvas
  10. Set the HUD to be the default HUD in the game mode you're using
  11. Put a breakpoint in FSlateRHIResourceManager::ReleaseResources and run the game

Result: On the second call of FSlateRHIResourceManager::ReleaseResources, the key of the first element in CachedBuffers will be junk.

Callstack

FSlateRenderDataHandle::Disconnect() Line 745 C++
FSlateRHIResourceManager::ReleaseResources() Line 1083 C++
FSlateRHIResourceManager::OnAppExit() Line 797 C++
TBaseRawMethodDelegateInstance<0,FSlateRHIResourceManager,void __cdecl(void)>::ExecuteIfSafe() Line 639 C++
TBaseMulticastDelegate<void>::Broadcast() Line 922 C++
FEngineLoop::AppPreExit() Line 3472 C++
FEngineLoop::Exit() Line 2514 C++
GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 163 C++
GuardedMainWrapper(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 126 C++
WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 202 C++

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-41775 in the post.

2
Login to Vote

Backlogged
ComponentTools - Slate
Affects Versions4.14
CreatedFeb 8, 2017
UpdatedSep 2, 2020