If UUserWidget::CreateWidgetInstance called a few times with the same name parameter, it creates a new widget instance only first time, following calls return a pointer to a previously created widget without any errors or warnings.
Test code:
UUserWidget* Widget1 = UUserWidget::CreateWidgetInstance( *this->GetWorld(), UMyUserWidget::StaticClass(), "TestNameOne" );
UUserWidget* Widget2 = UUserWidget::CreateWidgetInstance( *this->GetWorld(), UMyUserWidget::StaticClass(), "TestNameOne" );
UUserWidget* Widget3 = UUserWidget::CreateWidgetInstance( *this->GetWorld(), UMyUserWidget::StaticClass(), "TestNameTwo" );
UE_LOG( LogTemp, Log, TEXT( "%s" ), (Widget1 == Widget2 ? TEXT( "TRUE" ) : TEXT( "FALSE" )) );
UE_LOG( LogTemp, Log, TEXT( "%s" ), (Widget2 == Widget3 ? TEXT( "TRUE" ) : TEXT( "FALSE" )) );
Output is TRUE FALSE.
If this is a Create method, I expect it to create a new instance, not to return a pointer to the existing one.
Is it a bug or it should be like this?