OpenCV with memory leaks