what do you mean by action completes, me pointer wont get NULL unless you remove the entity.
Yes I mean when entity is removed. In my_action there is actually ent_remove(me) statement which is executed under some condition. So the entity disappears but panel created in my_function remains on screen.