Replace shared_ptr::reset() by assigning nullptr.