cleanup of AutoPtr and ArrayPtr