Ensure all resources shut down.