Skip to content

Commit 7aa1436

Browse files
committed
Remove reset of objects from libcam_stop
1 parent 0adef7b commit 7aa1436

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/libcam.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ int cls_libcam::start_mgr()
222222

223223
MOTION_LOG(NTC, TYPE_VIDEO, NO_ERRNO, "Starting.");
224224

225-
cam_mgr = std::make_unique<CameraManager>();
226225
retcd = cam_mgr->start();
227226
if (retcd != 0) {
228227
MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO
@@ -707,8 +706,6 @@ int cls_libcam::start_req()
707706
return -1;
708707
}
709708

710-
started_req = true;
711-
712709
const FrameBuffer::Plane &plane0 = buffer->planes()[0];
713710

714711
bytes = 0;
@@ -727,6 +724,8 @@ int cls_libcam::start_req()
727724

728725
requests.push_back(std::move(request));
729726

727+
started_req = true;
728+
730729
MOTION_LOG(NTC, TYPE_VIDEO, NO_ERRNO, "Finished.");
731730

732731
return 0;
@@ -828,17 +827,14 @@ void cls_libcam::libcam_stop()
828827
requests.clear();
829828

830829
frmbuf->free(config->at(0).stream());
831-
frmbuf.reset();
832830
}
833831

834832
if (started_aqr){
835833
camera->release();
836-
camera.reset();
837834
}
838835

839836
if (started_mgr) {
840837
cam_mgr->stop();
841-
cam_mgr.reset();
842838
}
843839

844840
started_cam = false;
@@ -988,6 +984,7 @@ cls_libcam::cls_libcam(cls_camera *p_cam)
988984
params = nullptr;
989985
reconnect_count = 0;
990986
cam->watchdog = cam->cfg->watchdog_tmo * 3; /* 3 is arbitrary multiplier to give startup more time*/
987+
cam_mgr = std::make_unique<CameraManager>();
991988
if (libcam_start() < 0) {
992989
MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO,_("libcam failed to open"));
993990
libcam_stop();

0 commit comments

Comments
 (0)