Cleanup both code and memory.