Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is no memory leak.
As we know, OpenCV uses auto-initialization for TBB. So task dispatcher often will be destroyed when the application completes. This is the reason, that VS reports about memory leak. When you use local variable cv::Ptr, it will be destroyed as usual local variable.

You shouldn't care about when it will be destroyed (but it will) and use construction with cv::Ptr in usual application, like this example. I'm suggest to use more accurate tools for memory analyze in case of TBB, like this.