diff --git a/modules/highgui/src/cap_avfoundation.mm b/modules/highgui/src/cap_avfoundation.mm index e189224642..0a70d7e3f6 100644 --- a/modules/highgui/src/cap_avfoundation.mm +++ b/modules/highgui/src/cap_avfoundation.mm @@ -969,6 +969,8 @@ IplImage* CvCaptureFile::retrieveFramePixelBuffer() { CVPixelBufferUnlockBaseAddress(pixels, 0); CVBufferRelease(pixels); + CMSampleBufferInvalidate(sampleBuffer); + CFRelease(sampleBuffer); [localpool drain]; return bgr_image;