Description

If a widget has playing animation node in finished animation event, calling StopAllAnimations appends a new UMGSequncePlayer to ActiveSequencePlayers array during array iteration and cause ensure condition failed.

Copying ActiveSequencePlayers into a temporary array works as a simple workaround.

void UUserWidget::StopAllAnimations()
{
	bStoppingAllAnimations = true;
	TArray<UUMGSequencePlayer*>	TemporaryArray = ActiveSequencePlayers;
	for (UUMGSequencePlayer* FoundPlayer : TemporaryArray)
	{
		if (FoundPlayer->GetPlaybackStatus() == EMovieScenePlayerStatus::Playing)
		{
			FoundPlayer->Stop();
		}
	}
	bStoppingAllAnimations = false;

	UpdateCanTick();
}

 

Steps to Reproduce
  1. open attached project on UE4.24 [Link Removed]
  2. Start PIE session

Result:

Ensure condition failed

// code placeholder
=== Handled ensure: ===Ensure condition failed: Lhs.CurrentNum == Lhs.InitialNum [File:C:\UE4_243DA\UE4\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 207]
Array has changed during ranged-for iteration!
Callstack

UE4Editor-UMG.dll!DispatchCheckVerify<bool,<lambda_c77323095a651dd7a69754f0cbb9655f> >() [c:\ue4_243da\ue4\engine\source\runtime\core\public\misc\assertionmacros.h:167]
UE4Editor-UMG.dll!UUserWidget::StopAllAnimations() [c:\ue4_243da\ue4\engine\source\runtime\umg\private\userwidget.cpp:725]
UE4Editor-CoreUObject.dll!UFunction::Invoke() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\class.cpp:4907]
UE4Editor-CoreUObject.dll!UObject::CallFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:927]
UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:997]
UE4Editor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:828]
UE4Editor-CoreUObject.dll!ProcessLocalFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1056]
UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:997]
UE4Editor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:828]
UE4Editor-CoreUObject.dll!ProcessLocalFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1056]
UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:997]
UE4Editor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:828]
UE4Editor-CoreUObject.dll!ProcessLocalFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1056]
UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:997]
UE4Editor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:828]
UE4Editor-CoreUObject.dll!ProcessLocalFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1056]
UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:997]
UE4Editor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:828]
UE4Editor-CoreUObject.dll!ProcessLocalFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1056]
UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:997]
UE4Editor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:828]
UE4Editor-CoreUObject.dll!ProcessLocalFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1056]
UE4Editor-CoreUObject.dll!UObject::ProcessContextOpcode() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2792]
UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:997]
UE4Editor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:828]
UE4Editor-CoreUObject.dll!ProcessLocalFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1056]
UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:997]
UE4Editor-CoreUObject.dll!UObject::ProcessInternal() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1081]
UE4Editor-CoreUObject.dll!UFunction::Invoke() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\class.cpp:4907]
UE4Editor-CoreUObject.dll!UObject::ProcessEvent() [c:\ue4_243da\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1912]
UE4Editor-Engine.dll!AActor::ProcessEvent() [c:\ue4_243da\ue4\engine\source\runtime\engine\private\actor.cpp:795]

...

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - Editor - UI Systems
Affects Versions4.244.25
Target Fix4.26.1
Fix Commit14870543
Release Commit14870543
CreatedDec 1, 2020
ResolvedDec 7, 2020
UpdatedApr 27, 2021
View Jira Issue