From 2122627877bd8e834ec283c6114c853105a4a502 Mon Sep 17 00:00:00 2001 From: Karl-Heinz Zimmer Date: Wed, 3 Apr 2013 17:54:29 +0200 Subject: [PATCH] Set ptr to NULL, so this method can be called repeatedly. This fixes a crash after unplugging web cam and trying to re-scan the cameras. --- modules/highgui/src/cap_libv4l.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/highgui/src/cap_libv4l.cpp b/modules/highgui/src/cap_libv4l.cpp index 63a2ff96b0..ec048aff77 100644 --- a/modules/highgui/src/cap_libv4l.cpp +++ b/modules/highgui/src/cap_libv4l.cpp @@ -1714,6 +1714,7 @@ static void icvCloseCAM_V4L( CvCaptureCAM_V4L* capture ){ #endif free(capture->deviceName); + capture->deviceName = NULL; //v4l2_free_ranges(capture); //cvFree((void **)capture); }