Hi there,

in this function:
cv::Mat ImageToOpenCVImageFilter::GetOpenCVMat()

is there a memory leak? Scenario being:
  1. Create IplImage* pointer to image data.
  2. cv::Mat creates a new default matrix.
  3. If img is valid, we create a cv::Mat from img, but the parameter false 
means we DONT copy data, which also means the destructor WONT destroy data. 
  4. We release the IplImage header, so mat now owns the image.
  5. The statement return mat causes mat to be copied as it returns.
  6. The mat object on the stack is now deleted WITHOUT destroying the image 
buffer.

Thanks

Matt



------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to