Replace shared_ptr with manual management of pointer.