getnamo / GlobalEventSystem-Unreal

Loosely coupled internal event system plugin for the Unreal Engine.
MIT License
276 stars 44 forks source link

Crash at EndPlay Attempting to call an unbound TFunction! #28

Open Bortronx opened 1 year ago

Bortronx commented 1 year ago

I'm receiving the following crash when using GES in Unreal 5.1.1 only on EndPlay

Assertion failed: Callable [File:\EpicGames\UE_5.1\Engine\Source\Runtime\Core\Public\Templates\Function.h] [Line: 596] Attempting to call an unbound TFunction!

UnrealEditor_GlobalEventSystem!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<0>,void __cdecl(void)>::operator()() [\EpicGames\UE_5.1\Engine\Source\Runtime\Core\Public\Templates\Function.h:601]
UnrealEditor_GlobalEventSystem!AGESWorldListenerActor::EndPlay() [\Plugins\GlobalEventSystem-Unreal\Source\GlobalEventSystem\Private\GESWorldListenerActor.cpp:24]
UnrealEditor_Engine
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll
getnamo commented 1 year ago

Do you call use GESUnbind All Events for Context to balance your bind calls? https://github.com/getnamo/GlobalEventSystem-Unreal#unbinding

While technically optional, there are some cases that can slip past the auto-unbinding system and cause crashes like this so I recommend using unbind calls to balance your bind calls on endplay callbacks.

Bortronx commented 1 year ago

@getnamo Thanks that's how I fixed it.