diff --git a/modules/highgui/src/cap_pvapi.cpp b/modules/highgui/src/cap_pvapi.cpp index 1020e17390..0e3f03f405 100644 --- a/modules/highgui/src/cap_pvapi.cpp +++ b/modules/highgui/src/cap_pvapi.cpp @@ -109,6 +109,7 @@ protected: CvCaptureCAM_PvAPI::CvCaptureCAM_PvAPI() { monocrome=false; + memset(&this->Camera, 0, sizeof(this->tCamera)); } void CvCaptureCAM_PvAPI::Sleep(unsigned int time) { @@ -358,8 +359,6 @@ CvCapture* cvCreateCameraCapture_PvAPI( int index ) { CvCaptureCAM_PvAPI* capture = new CvCaptureCAM_PvAPI; - memset(&capture->Camera, 0, sizeof(tCamera)); - if ( capture->open( index )) return capture;