Does destroying the Ability Owner or Avatar during Gameplay Ability execution cause crash?

My friend said that if he destroy the Ability Owner or Avatar before the Gameplay Ability ends, game can crash.

A simple solution is to add a Delay(0) before destroying the Actor so that the destruction operation is delayed until the next frame.

However, when I tried to destroy the Ability Owner, I found that even without Delay(0), the game didn’t crash, and everything worked fine. Is this related to the version of Unreal? My version is 5.4.4, my friend is using 5.3.

Additional questions:

  1. What is the underlying logic of this crash problem and solution?
  2. I tried destroying the Actor in “Event on End Ability”, but this causes the frame rate to plummet, and if multiple Actors are destroyed at the same time, the framerate drops to almost 0. However, when my friend destroys the actor in this way, the game still crashes, what’s going on?

When I do like this, the frame rate plummets when an actor is destroyed. And when my friend does like this, the game crashes.

Thanks a lot to the techies who can answer my question!

what error does he get?

the underlying logic is likely trying to access a Ref that is no longer valid

hard to give a solution without seeing any logic but the first step is to use IsValid nodes before any Refs

Many thanks to your reply! He said he didn’t get an error or warning message, and his Unreal editor directly crash, which is a bit weird.

i mean the crash itself should have a crashlog