OpenCv memory clean up