releaseTreeImmediatelyOrOnViewDetached

We may need to wait until the corresponding view is detached before releasing the tree as the view might need to run an animation