[UE5.1, Bug report] UUserWidget::NativeConstruct "ticks" when the asset is hovered.

This looks ridiculous, I’m pretty sure it should not be doing this.
As far as I know NativePreConstruct is supposed to run at least once but only when it is added to a parent or removed from it. But it runs infinitely as a “tick” when you hover a UserWidget asset in the editor.

  1. Right click the asset. NativePreConstruct runs twice.
  2. unhover then hover the asset.
  3. See it go batsh*t for no reason.

obv. you need to print a debug message to notice but this is unexpected.

Alternating stacks:

>	UnrealEditor-ThatPlugin.dll!UMainMenuWidget::NativePreConstruct() Line 53	C++
 	UnrealEditor-UMG.dll!UUserWidget::OnWidgetRebuilt() Line 812	C++
 	UnrealEditor-UMG.dll!UWidget::TakeWidget_Private(TFunctionRef<TSharedPtr<SObjectWidget,1> __cdecl(UUserWidget *,TSharedRef<SWidget,1>)> ConstructMethod) Line 999	C++
 	UnrealEditor-UMG.dll!UWidget::TakeWidget() Line 916	C++
 	UnrealEditor-UMGEditor.dll!FWidgetBlueprintEditorUtils::DrawSWidgetInRenderTargetInternal(UUserWidget * WidgetInstance, FRenderTarget * RenderTarget2D, UTextureRenderTarget2D * TextureRenderTarget, UE::Math::TVector2<double> ThumbnailSize, bool bIsForThumbnail, TOptional<UE::Math::TVector2<double>> ThumbnailCustomSize, EThumbnailPreviewSizeMode ThumbnailSizeMode) Line 2210	C++
 	UnrealEditor-UMGEditor.dll!FWidgetBlueprintEditorUtils::DrawSWidgetInRenderTargetForThumbnail(UUserWidget * WidgetInstance, FRenderTarget * RenderTarget2D, UE::Math::TVector2<double> ThumbnailSize, TOptional<UE::Math::TVector2<double>> ThumbnailCustomSize, EThumbnailPreviewSizeMode ThumbnailSizeMode) Line 2193	C++
 	UnrealEditor-UMGEditor.dll!UWidgetBlueprintThumbnailRenderer::Draw(UObject * Object, int X, int Y, unsigned int Width, unsigned int Height, FRenderTarget * RenderTarget, FCanvas * Canvas, bool bAdditionalViewFamily) Line 207	C++
 	UnrealEditor-UnrealEd.dll!ThumbnailTools::RenderThumbnail(UObject * InObject, const unsigned int InImageWidth, const unsigned int InImageHeight, ThumbnailTools::EThumbnailTextureFlushMode::Type InFlushMode, FTextureRenderTargetResource * InTextureRenderTargetResource, FObjectThumbnail * OutThumbnail) Line 4970	C++
 	UnrealEditor-UnrealEd.dll!FAssetThumbnailPool::LoadThumbnail(TSharedRef<FAssetThumbnailPool::FThumbnailInfo,1> ThumbnailInfo, bool & bIsAssetStillCompiling, const FAssetData & CustomAssetToRender) Line 1198	C++
 	UnrealEditor-UnrealEd.dll!FAssetThumbnailPool::Tick(float DeltaTime) Line 1131	C++
 	UnrealEditor-UnrealEd.dll!FTickableEditorObject::TickObjects(const float DeltaSeconds) Line 50	C++
 	UnrealEditor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1648	C++
 	UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 517	C++
 	UnrealEditor.exe!FEngineLoop::Tick() Line 5369	C++
 	[Inline Frame] UnrealEditor.exe!EngineTick() Line 66	C++
 	UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 202	C++
 	UnrealEditor.exe!GuardedMainWrapper(const wchar_t * CmdLine) Line 107	C++
 	UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 244	C++
 	UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 282	C++

>	UnrealEditor-ThatPlugin.dll!<lambda_27ff781a90f46d067560d11dab9bca51>::operator()<FLogCategory,wchar_t [7],wchar_t const *,wchar_t const *>(const FLogCategory & LCategoryName, const wchar_t[7] & LFormat, const wchar_t * const & <UE_LOG_Args_0>, const wchar_t * const & <UE_LOG_Args_1>) Line 53	C++
 	UnrealEditor-ThatPlugin.dll!DispatchCheckVerify<void,<lambda_27ff781a90f46d067560d11dab9bca51>,FLogCategory,wchar_t [7],wchar_t const *,wchar_t const *>(UMainMenuWidget::NativePreConstruct::__l9::<lambda_27ff781a90f46d067560d11dab9bca51> && Inner, const FLogCategory & <Args_0>, const wchar_t[7] & <Args_1>, const wchar_t * const & <Args_2>, const wchar_t * const & <Args_3>) Line 172	C++
 	UnrealEditor-ThatPlugin.dll!UMainMenuWidget::NativePreConstruct() Line 53	C++
 	UnrealEditor-UMG.dll!UUserWidget::OnWidgetRebuilt() Line 812	C++
 	UnrealEditor-UMG.dll!UWidget::TakeWidget_Private(TFunctionRef<TSharedPtr<SObjectWidget,1> __cdecl(UUserWidget *,TSharedRef<SWidget,1>)> ConstructMethod) Line 999	C++
 	UnrealEditor-UMG.dll!UWidget::TakeWidget() Line 916	C++
 	UnrealEditor-UMGEditor.dll!FWidgetBlueprintEditorUtils::DrawSWidgetInRenderTargetInternal(UUserWidget * WidgetInstance, FRenderTarget * RenderTarget2D, UTextureRenderTarget2D * TextureRenderTarget, UE::Math::TVector2<double> ThumbnailSize, bool bIsForThumbnail, TOptional<UE::Math::TVector2<double>> ThumbnailCustomSize, EThumbnailPreviewSizeMode ThumbnailSizeMode) Line 2210	C++
 	UnrealEditor-UMGEditor.dll!FWidgetBlueprintEditorUtils::DrawSWidgetInRenderTargetForThumbnail(UUserWidget * WidgetInstance, FRenderTarget * RenderTarget2D, UE::Math::TVector2<double> ThumbnailSize, TOptional<UE::Math::TVector2<double>> ThumbnailCustomSize, EThumbnailPreviewSizeMode ThumbnailSizeMode) Line 2193	C++
 	UnrealEditor-UMGEditor.dll!UWidgetBlueprintThumbnailRenderer::Draw(UObject * Object, int X, int Y, unsigned int Width, unsigned int Height, FRenderTarget * RenderTarget, FCanvas * Canvas, bool bAdditionalViewFamily) Line 207	C++
 	UnrealEditor-UnrealEd.dll!ThumbnailTools::RenderThumbnail(UObject * InObject, const unsigned int InImageWidth, const unsigned int InImageHeight, ThumbnailTools::EThumbnailTextureFlushMode::Type InFlushMode, FTextureRenderTargetResource * InTextureRenderTargetResource, FObjectThumbnail * OutThumbnail) Line 4970	C++
 	UnrealEditor-UnrealEd.dll!FAssetThumbnailPool::LoadThumbnail(TSharedRef<FAssetThumbnailPool::FThumbnailInfo,1> ThumbnailInfo, bool & bIsAssetStillCompiling, const FAssetData & CustomAssetToRender) Line 1198	C++
 	UnrealEditor-UnrealEd.dll!FAssetThumbnailPool::Tick(float DeltaTime) Line 1131	C++
 	UnrealEditor-UnrealEd.dll!FTickableEditorObject::TickObjects(const float DeltaSeconds) Line 50	C++
 	UnrealEditor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1648	C++
 	UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 517	C++
 	UnrealEditor.exe!FEngineLoop::Tick() Line 5369	C++
 	[Inline Frame] UnrealEditor.exe!EngineTick() Line 66	C++
 	UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 202	C++
 	UnrealEditor.exe!GuardedMainWrapper(const wchar_t * CmdLine) Line 107	C++
 	UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 244	C++
 	UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 282	C++

We’re not seriously going to tick NativePreConstruct to show a thumbnail are we -_-