Problem with Events while trying to restart WidgetAnimation from internal event

Here’s the case:

  1. In widget BP has some WidgetAnimation
  2. It starts by C++ Event

UFUNCTION(BlueprintImplementableEvent, Category = "Portrait Button")
	void OnDisplayAnim();

  1. OnDisplayAnim Event in BP calls specific animation by PlayAnimation
  2. While WidgetAnimation playing at some point from internal animation event it calls specific C++ method

UFUNCTION(BlueprintCallable, Category = "Portrait Button")
	void OnCheckAnim();

  1. This method checks should we restart current WidgetAnimation or not.
  2. If yes, I call again OnDisplayAnim()
  3. And this leads to a strange behavior:
  • In UE 4.19 I get error in MovieSceneEventTemplate.cpp (71) “array has changed during ranged-for iteration”.
    I made test Level to check this and found out that if restart animation using this way it doesn’t restart current animation. Looks like it restarts this frame and makes some recursive with calling OnCheckAnim
  • In UE 4.24 I get another error “Access violation reading location 0xFFFFFFFFFFFFFFFF”. And here I’m out of ideas that happening there.

Could anyone clarify this behavior for me? If need I can send a test project.