Commit 4f328d83 authored by peng xiao's avatar peng xiao

Fix a potential bug of ocl::CannyBuf.

The program would crash if release is called twice.
parent 75861452
...@@ -112,7 +112,11 @@ void cv::ocl::CannyBuf::release() ...@@ -112,7 +112,11 @@ void cv::ocl::CannyBuf::release()
mapBuf.release(); mapBuf.release();
trackBuf1.release(); trackBuf1.release();
trackBuf2.release(); trackBuf2.release();
openCLFree(counter); if(counter)
{
openCLFree(counter);
counter = NULL;
}
} }
namespace cv namespace cv
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment