Delegate remove deprecated

I was using RemoveRaw to remove delegates, but recently started to get warnings about deprecation of that method. It is said, that I have to use FDelegateHandle for removing delegates, but I have no idea how to do this: FDelegateHandle don’t have any methods like remove.

Can someone please clarify how we should handle delegates removing now?

You need to save the result of your call to add the binding to the delegate like so:

FDelegateHandle MyHandle = MyDelegate.AddRaw(this, &FMe::OnThing);

...

MyDelegate.Remove(MyHandle);
1 Like