Handled error Ensure condition failed InvocationList[ CurFunctionIndex ] != InDelegate

The project I’m working on used to compile in less than 6s, now it takes around 100s eventhough the code base is about the same size.

Hotreload takes a lot longer than usual, and memory usage goes way up when Holtreload starts running and the editor becomes extremely crash prone (an editor crash happens within 20s after the hotreload).

The only warning I get in the log is this :

LogOutputDevice:Warning: === Handled error: ===
Ensure condition failed: InvocationList[ CurFunctionIndex ] != InDelegate [File:D:\Program Files\Epic Games\4.12\Engine\Source\Runtime\Core\Public\UObject\ScriptDelegates.h] [Line: 503]
Stack: 
UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:183]
UE4Editor-Core.dll!FDebug::EnsureFailed() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:327]
UE4Editor-Core.dll!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:451]
UE4Editor-NamelessProject-362.dll
UE4Editor-NamelessProject-362.dll
UE4Editor-NamelessProject-362.dll
UE4Editor-CoreUObject.dll!FObjectInitializer::PostConstructInit() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2611]
UE4Editor-CoreUObject.dll!FObjectInitializer::~FObjectInitializer() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2476]
UE4Editor-CoreUObject.dll!StaticConstructObject_Internal() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2982]
UE4Editor-CoreUObject.dll!FObjectInstancingGraph::GetInstancedSubobject() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\corenative.cpp:190]
UE4Editor-CoreUObject.dll!FObjectInstancingGraph::InstancePropertyValue() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\corenative.cpp:263]
UE4Editor-CoreUObject.dll!UObjectPropertyBase::InstanceSubobjects() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\propertybaseobject.cpp:34]
UE4Editor-CoreUObject.dll!UStruct::InstanceSubobjectTemplates() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:2265]
UE4Editor-CoreUObject.dll!FObjectInitializer::InstanceSubobjects() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2726]
UE4Editor-CoreUObject.dll!FObjectInitializer::PostConstructInit() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2610]
UE4Editor-CoreUObject.dll!FObjectInitializer::~FObjectInitializer() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2476]
UE4Editor-CoreUObject.dll!UClass::CreateDefaultObject() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:3344]
UE4Editor-CoreUObject.dll!UClass::GetDefaultObject() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\public\uobject\class.h:2199]
UE4Editor-KismetCompiler.dll!FKismetCompilerContext::FinishCompilingClass() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\kismetcompiler\private\kismetcompiler.cpp:1905]
UE4Editor-KismetCompiler.dll!FKismetCompilerContext::Compile() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\kismetcompiler\private\kismetcompiler.cpp:3431]
UE4Editor-KismetCompiler.dll!FKismet2CompilerModule::CompileBlueprintInner() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\kismetcompiler\private\kismetcompilermodule.cpp:100]
UE4Editor-KismetCompiler.dll!FKismet2CompilerModule::CompileBlueprint() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\kismetcompiler\private\kismetcompilermodule.cpp:203]
UE4Editor-UnrealEd.dll!FKismetEditorUtilities::CompileBlueprint() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\kismet2\kismet2.cpp:756]
UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::CompileChildren() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\kismet2\kismetreinstanceutilities.cpp:519]
UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::ReinstanceObjects() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\kismet2\kismetreinstanceutilities.cpp:637]
UE4Editor-HotReload.dll!FHotReloadModule::ReinstanceClass() [d:\build\++ue4+release-4.12+compile\sync\engine\source\developer\hotreload\private\hotreload.cpp:1183]
UE4Editor-HotReload.dll!FHotReloadModule::ReinstanceClasses() [d:\build\++ue4+release-4.12+compile\sync\engine\source\developer\hotreload\private\hotreload.cpp:1170]
UE4Editor-HotReload.dll!TBaseRawMethodDelegateInstance<0,FHotReloadModule,void __cdecl(void)>::ExecuteIfSafe() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:642]
UE4Editor-CoreUObject.dll!UClassReplaceHotReloadClasses() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:674]
UE4Editor-CoreUObject.dll!ProcessNewlyLoadedUObjects() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:821]
UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:1021]
UE4Editor-Core.dll!TBaseMulticastDelegate<void>::Broadcast() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:921]
UE4Editor-Core.dll!FModuleManager::LoadModuleWithFailureReason() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\modules\modulemanager.cpp:461]
UE4Editor-Core.dll!FModuleManager::LoadModule() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\modules\modulemanager.cpp:322]
UE4Editor-HotReload.dll!FHotReloadModule::DoHotReloadInternal() [d:\build\++ue4+release-4.12+compile\sync\engine\source\developer\hotreload\private\hotreload.cpp:770]
UE4Editor-HotReload.dll!FHotReloadModule::DoHotReloadFromIDE() [d:\build\++ue4+release-4.12+compile\sync\engine\source\developer\hotreload\private\hotreload.cpp:1393]
UE4Editor-HotReload.dll!FHotReloadModule::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\developer\hotreload\private\hotreload.cpp:1329]
UE4Editor-Core.dll!FTicker::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\containers\ticker.cpp:79]
UE4Editor.exe!FEngineLoop::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2879]
UE4Editor.exe!GuardedMain() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\launch.cpp:148]
UE4Editor.exe!GuardedMainWrapper() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor.exe!WinMain() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
KERNEL32.DLL
ntdll.dll
ntdll.dll

I once had a problem like this and it was due to using delegates without UFUNCTION tags.

Now I can’t figure out the source of the problem.

Anyone has any idea ?

Using 4.12.5, windows 10 64b.

1 Like

I was getting this warning when pressing Build in my Level.

It’s probably not your case, but I ran the Editor in debug mode and realized that it was related to the binding of functions to a delegate inside my animation instance’s NativeInitializeAnimation function, which was getting executed in the Build process. This had never happened to me before, but I got rid of it by binding them in the character’s begin play function instead. (I’m using 4.13.1, maybe it’s related to that)

It was delegate problem after all.

I had a BlueprintAssignable delegate that I bound in a UI blueprint. I did the binding in c++ and the problem went away.

Thanks Ghar.

For anybody stumbling upon this issue: This error means, that the function you’d like to add is already in the invocation list. I got this error a lot when doing level streaming, when calling AddDynamic in BeginPlay() of characters that were loading.

The answer is to also call “RemoveDynamic” in EndPlay() - which is good practice I guess.

12 Likes

Using 5.1. This link helped me solve this. Specifically use AddUniqueDynamic() instead of AddDynamic().

10 Likes

@pezzott1 thanks! :+1:
Had this problem on UE503. The error message from the ensure is now gone.
I have 2 instances of an actor component each binding to the same event of 2 instances of another actor component.

1 Like

@pezzott1 Thank you ! This solved my problem !

1 Like

You saved my life!!! I had many delegates to which I assigned AddDynamic() instead of AddUniqueDynamic(), which was causing enormous delay, and often purely crashed the editor, at launch. Thanks so much!

1 Like

@pezzott1

Thanks! This helped me too. :slight_smile:

But I had once again the typical C++ table flipping moment :rage:. Why can’t the error message just tell me something along the lines of same function being bound second time, instead of riddles like “InvocationList[ CurFunctionIndex ] != InDelegate”

I swear C++ is Unreal’s weakest point :smiling_face_with_tear:

1 Like