Use a scoped_ptr instead