UAbilitySystemComponent::HandleGameplayEvent issues

I do agree GenericGameplayEventCallbacks should be protected heck even private, cause the functions should be the only way to access such map.

Regarding clean up, that should be the job of whatever binds to it. This is common across C++ and most languages, that you should be responsible for cleaning up anything you have registered to. It would be highly inefficient for the ASC to go through all the map and check if a delegate is still valid. Epic traditionally had a bit of a history, expecially with GameplayAbilities with things being public that really shouldn’t. Actually common across most of the code base. They have done a good job so far moving stuff to protected/private where needed. I am really strict on exposing things raw in the public interface without good reason.

But yeah i just wanted to point out the cleanup issue is not really an issue the system should be handling. Sure it *could*, but why should it?. We have very strict rules in place to bind and unbind things properly instead of relying on the engine/other code to “possibly” do it.

One thing we do is run an audit over our gameplay abilities (and gameplay effects) to monitor and check for things that are not correct. You *COULD* also run validations if such an instance happens to catch these errors at your code level.

Simply overriding IsDataValid should help you alleviate such issues. We have such validations in our speciailized version of GameplayAbility (and our specialized version of GameplayEffect, purely for additional validation only).