Ensure that the stack is cleared at shutdown time.