Freeing a little more memory when exiting