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

**URL:** <https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872>\
**Category:** C++\
**Tags:** compiling, unreal-engine, CPP, question\
**Created:** [July 13, 2016, 11:25am UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872 "2016-07-13T11:25:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bolobolo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bolobolo/32/88706_2.png) [@Bolobolo](https://forums.unrealengine.com/u/Bolobolo)\
**Post date:** [July 13, 2016, 11:25am UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/1 "2016-07-13T11:25:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ghar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ghar](https://forums.unrealengine.com/u/Ghar)\
**Post date:** [October 4, 2016, 10:31pm UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/2 "2016-10-04T22:31:56Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Bolobolo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bolobolo/32/88706_2.png) [@Bolobolo](https://forums.unrealengine.com/u/Bolobolo)\
**Post date:** [October 12, 2016, 4:03pm UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/3 "2016-10-12T16:03:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Zcience](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zcience/32/951950_2.png) [@Zcience](https://forums.unrealengine.com/u/Zcience)\
**Post date:** [May 4, 2021, 7:12pm UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/4 "2021-05-04T19:12:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [October 18, 2022, 9:12pm UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/5 "2022-10-18T21:12:46Z")

</div>

Using 5.1. This [link](https://dawnarc.com/2019/05/ue4error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/) helped me solve this. Specifically `use AddUniqueDynamic() instead of AddDynamic()`.

---

<div class="post-metadata">

**Author:** ![Maciek\_Leto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/maciek_leto/32/1194559_2.png) [@Maciek\_Leto](https://forums.unrealengine.com/u/Maciek_Leto)\
**Post date:** [October 19, 2022, 8:20pm UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/6 "2022-10-19T20:20:50Z")

</div>

> [@pezzott1](#):
>
> use AddUniqueDynamic() instead of AddDynamic()

@pezzott1 thanks! 👍  
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.

---

<div class="post-metadata">

**Author:** ![Ellminster](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ellminster](https://forums.unrealengine.com/u/Ellminster)\
**Post date:** [February 10, 2023, 12:48am UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/8 "2023-02-10T00:48:10Z")

</div>

@pezzott1 Thank you ! This solved my problem !

---

<div class="post-metadata">

**Author:** ![roudoudz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roudoudz/32/493225_2.png) [@roudoudz](https://forums.unrealengine.com/u/roudoudz)\
**Post date:** [March 18, 2023, 10:28am UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/9 "2023-03-18T10:28:06Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Rawalanche](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rawalanche/32/906578_2.png) [@Rawalanche](https://forums.unrealengine.com/u/Rawalanche)\
**Post date:** [May 11, 2024, 7:45pm UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/10 "2024-05-11T19:45:06Z")

</div>

@pezzott1

Thanks! This helped me too. 🙂

But I had once again the typical C++ table flipping moment 😡. 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 🥲

---

<div class="post-metadata">

**Author:** ![user\_e792ae809be9a8c3592687a49510cdcfe25e6dab1ee35f0f6d5dea](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/user_e792ae809be9a8c3592687a49510cdcfe25e6dab1ee35f0f6d5dea/32/633877_2.png) [@user\_e792ae809be9a8c3592687a49510cdcfe25e6dab1ee35f0f6d5dea](https://forums.unrealengine.com/u/user_e792ae809be9a8c3592687a49510cdcfe25e6dab1ee35f0f6d5dea)\
**Post date:** [May 30, 2025, 11:03am UTC](https://forums.unrealengine.com/t/handled-error-ensure-condition-failed-invocationlist-curfunctionindex-indelegate/363872/11 "2025-05-30T11:03:24Z")

</div>

```
My situation is that... maybe blueprint bug (but i never write bind operation in blueprint), maybe construction bug (at the beginning i write it in Constructor, later changed to beginplay.)

And there's no any other bind. only one ,no repetition. 

I delete the cache files like Intermediate and rebuild. error again. 

then i think maybe a blueprint bug——I used to be often cruelly hitted by blueprint bugs. So **i try to change the function name. it works.**

Hope this can help you. I don't know why i can't delete the cache. through it works, i lost my clean project. TvT

```
