Use std::unique_ptr() instead of delete.