Whether the event stays bound?

Thank you for your answer and explanation.
My immediate thought was that it couldn’t just become unlinked, so I reworked the function a bit:

void UHUDWidgetBase::TryToInvokeNotification()
{
	if(CurrentNotification)
	{
		CurrentNotification->OnNotificationStopDisplay.RemoveDynamic(this, &UHUDWidgetBase::TryToInvokeNotification);
		CurrentNotification = nullptr;
	}

	if(WidgetQueue.Num() == 0) return;

	CurrentNotification = WidgetQueue[0];
	CurrentNotification->NotificationDisplay();
	WidgetQueue.RemoveAt(0);

	CurrentNotification->OnNotificationStopDisplay.AddDynamic(this, &UHUDWidgetBase::TryToInvokeNotification);
}

1 Like