提交 866f8eb1 编写于 作者: A Arek 提交者: Alexander Alekhin

Merge pull request #7695 from ArkadiuszRaj:aravis-release-bug-fix

* Aravis: fixing releasing object when no communication with camera is possible

* Removing unnecessary include
上级 30807b26
...@@ -188,11 +188,12 @@ CvCaptureCAM_Aravis::CvCaptureCAM_Aravis() ...@@ -188,11 +188,12 @@ CvCaptureCAM_Aravis::CvCaptureCAM_Aravis()
void CvCaptureCAM_Aravis::close() void CvCaptureCAM_Aravis::close()
{ {
if(camera) if(camera) {
stopCapture(); stopCapture();
g_object_unref(camera); g_object_unref(camera);
camera = NULL; camera = NULL;
}
} }
bool CvCaptureCAM_Aravis::getDeviceNameById(int id, std::string &device) bool CvCaptureCAM_Aravis::getDeviceNameById(int id, std::string &device)
...@@ -559,8 +560,10 @@ void CvCaptureCAM_Aravis::stopCapture() ...@@ -559,8 +560,10 @@ void CvCaptureCAM_Aravis::stopCapture()
{ {
arv_camera_stop_acquisition(camera); arv_camera_stop_acquisition(camera);
g_object_unref(stream); if(stream) {
stream = NULL; g_object_unref(stream);
stream = NULL;
}
} }
bool CvCaptureCAM_Aravis::startCapture() bool CvCaptureCAM_Aravis::startCapture()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册