Description

URichTextBlock::UpdateStyleData() does not check whether DecoratorClasses already had any specificed DecoratorClass. So every time you turn UMG on and off from the Viewport, Decorator Classes will increase indefinitely.

I propose that we add check code to a following code ( ex. URichTextBlock::GetDecoratorByClass )

 

void URichTextBlock::UpdateStyleData()void URichTextBlock::UpdateStyleData()
{ 
...

if (!ResolvedClass->HasAnyClassFlags(CLASS_Abstract))
{ 
   URichTextBlockDecorator* Decorator = NewObject<URichTextBlockDecorator>(this, ResolvedClass); 
   InstanceDecorators.Add(Decorator); 
}

 

Steps to Reproduce
  1. Create DecoratorClasse based on URichTextBlockImageDecorator
  2. Create WBP
  3. add RichTextBlock to 2
  4. set 1 to DecoratorClasse of 3
  5. PIE
  6. call Add to viewport to 2 
  7. call Remove from parent to 2
  8. call add to viewport to 2

result : DecoratorClasses of RichTextBlock has 2 instances.

Have Comments or More Details?

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

1
Login to Vote

Fixed
ComponentUE - Editor - UI Systems
Affects Versions4.264.27
Target Fix5.0
Fix Commit17830851
CreatedJul 29, 2021
ResolvedOct 15, 2021
UpdatedNov 30, 2021
View Jira Issue