Description

By starting PIE while an uncompiled widget is open in the widget editor, it's possible to trigger a call to NativeDestruct on the preview widget. This is especially dangerous because NativeConstruct hasn't been called, so objects assumed to be initialized by Construct may not be when Destruct is called. It appears we set designer flags on the preview widget in FWidgetBlueprintEditor::OnBlueprintChangedImpl, but this call does not occur when the widget is compiled as a result of starting PIE. Since no designer flags are set, the call to NativeDestroy happens when it shouldn't. 

Steps to Reproduce
  1.  Drop breakpoints on UUserWidget::NativeConstruct and UUserWidget::NativeDestruct
  2. Open a UserWidget in the widget editor. Make a change. Do not compile
  3. Start PIE
  4. Note that NativeDestruct is called despite NativeConstruct never being called

 

Have Comments or More Details?

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

3
Login to Vote

Won't Fix
ComponentUE - Editor - UI Systems
Affects Versions4.194.20
CreatedJun 4, 2018
ResolvedAug 18, 2021
UpdatedAug 18, 2021