Quote:

but it still seem to use the pointer.



What is "it"? If your script is still using the pointer, the most common solution would be to set it to NULL and check everywhere you use it if it's not NULL. Actions and such should be stopped automatically when the entity is removed, so that's of no concern.