Destroying Visual Effects

When you create an effect from a player and set a variable on it, you can destroy that effect through that variable.
This doesn’t seem to happen if the player is dead, like you can’t destroy effects at all whenever the player dies.
To simplify, if I make Pharah create an effect, and destroy it when she dies, then the effect doesn’t destroy itself.