From 71a2a1be8e3931c79272dc245e4c0b90eb2a56a2 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Wed, 17 Aug 2011 09:42:07 +0200 Subject: [PATCH] Move m_pprevFrame free just before the clone of the latest frame for readability --- ext/opencv/MotionCells.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/opencv/MotionCells.cpp b/ext/opencv/MotionCells.cpp index 2b81b305dd..7db9896e51 100644 --- a/ext/opencv/MotionCells.cpp +++ b/ext/opencv/MotionCells.cpp @@ -168,8 +168,6 @@ MotionCells::performDetectionMotionCells (IplImage * p_frame, m_pbwImage = cvCreateImage (m_frameSize, IPL_DEPTH_8U, 1); cvPyrDown (m_pprevFrame, m_pprevDown); cvCvtColor (m_pprevDown, m_pprevgreyImage, CV_RGB2GRAY); - if (m_pprevFrame) - cvReleaseImage (&m_pprevFrame); cvPyrDown (m_pcurFrame, m_pcurDown); cvCvtColor (m_pcurDown, m_pcurgreyImage, CV_RGB2GRAY); m_pdifferenceImage = cvCloneImage (m_pcurgreyImage); @@ -268,6 +266,8 @@ MotionCells::performDetectionMotionCells (IplImage * p_frame, cvReleaseImage (&transparencyimg); } + if (m_pprevFrame) + cvReleaseImage (&m_pprevFrame); m_pprevFrame = cvCloneImage (m_pcurFrame); m_framecnt = 0; if (m_pcurFrame)