How to avoid engine destroy the character when player leave or get disconnect

Then try to do debug and put brake point and then see call stack whio is calling that function