fix pointer lifetime issue in camera::set_camera