Description

When using an Optional Name parameter in Create Dynamic Material Instance while using the same Optional Name twice in UMG the engine crashes.

I have tested this in a actor blueprint that applies the texture to a cube mesh and their isn't a crash.

Found in 4.24.2 CL#11100242
Reproduced in 4.23.1 CL#9631420, 4.26 Main CL#11421855

Steps to Reproduce
  1. Create a UI Widget (DemoWidget).
  2. Add a button and an image to DemoWidget.
  3. Create a new material an set Material Domain to "User Interface".
  4. In DemoWidget add an On Clicked for the button that calles "Create Dynamic Material Instance" using an optional name.
  5. Assign the image in DemoWidget the material made in step 4 using "Set Brush from Material".
  6. In the level blueprint create a DemoWidget and add it to the viewport.
  7. Play the scene and click the button twice.

Result: Engine crashes.

Expected: Engine doesn't crash.

Callstack

LoginId:9a8d08644d702ac44f074090ac311686
EpicAccountId:580fb2844ad145d79dff08f42acea7c6

Assertion failed: MaterialObjectWeakPtr.IsValid(bEvenIfPendingKill, bThreadSafe) [Link Removed] [Line: 101] Material UiMaterial has become invalid. This means the resource was garbage collected while slate was using it

UE4Editor_Core!AssertFailedImplV() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:105]
UE4Editor_Core!FDebug::CheckVerifyFailedImpl() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:455]
UE4Editor_SlateRHIRenderer!DispatchCheckVerify<void,<lambda_a21d876fe726a83b877fc869f570fe39> >() [d:\build\++ue4\sync\engine\source\runtime\core\public\misc\assertionmacros.h:167]
UE4Editor_SlateRHIRenderer!FSlateMaterialResource::CheckForStaleResources() [d:\build\++ue4\sync\engine\source\runtime\slaterhirenderer\private\slatematerialresource.cpp:101]
UE4Editor_SlateRHIRenderer!FSlateRHIRenderingPolicy::DrawElements() [d:\build\++ue4\sync\engine\source\runtime\slaterhirenderer\private\slaterhirenderingpolicy.cpp:1025]
UE4Editor_SlateRHIRenderer!FSlateRHIRenderer::DrawWindow_RenderThread() [d:\build\++ue4\sync\engine\source\runtime\slaterhirenderer\private\slaterhirenderer.cpp:871]
UE4Editor_SlateRHIRenderer!TEnqueueUniqueRenderCommandType<`FSlateRHIRenderer::DrawWindows_Private'::`26'::SlateDrawWindowsCommandName,<lambda_2a9c0a9fed59e8507bcd2f8c06e1febe> >::DoTask() [d:\build\++ue4\sync\engine\source\runtime\rendercore\public\renderingthread.h:198]
UE4Editor_SlateRHIRenderer!TGraphTask<TEnqueueUniqueRenderCommandType<`FSlateRHIRenderer::DrawWindows_Private'::`26'::SlateDrawWindowsCommandName,<lambda_2a9c0a9fed59e8507bcd2f8c06e1febe> > >::ExecuteTask() [d:\build\++ue4\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:847]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:686]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:583]
UE4Editor_RenderCore!RenderingThreadMain() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:340]
UE4Editor_RenderCore!FRenderingThread::Run() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:471]
UE4Editor_Core!FRunnableThreadWin::Run() [d:\build\++ue4\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:96]

Have Comments or More Details?

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

3
Login to Vote

Duplicate
ComponentUE - Editor - UI Systems
Affects Versions4.23.14.24.24.26
CreatedFeb 17, 2020
ResolvedSep 17, 2020
UpdatedSep 17, 2020
View Jira Issue