Temp files are not deleted

asked 2016-07-12 01:13:19 -0600

I'm using the OpenCvSharp3 wrapper for the .NET framework.

I wrote a unit test that calls the function Mat.FromImageData() 10000 times to decode a 4 MB picture. (i think internally it calls cv::imdecode).

For each call a tempory file ocvWXYZ.tmp with 4 MB size is being created under C:\Users{Username}\AppData\Local\Temp. And then, after a few seconds, when there is no more space on the C drive, my application crashes.

I can only find one link which is perhaps related to my problem: OpenCv issue #2403

Could be that my english is not good enough to understand what i should do now. Is it a bug and if yes in which version is it fixed? In general, who is responsibel to delete the temp files? Because i'm just a stupid caller of the wrapper function and i don't want to care about the lifecycle of the tempfile or the matrix etc. Furthermore, i don't know how to get the temp filename.

Thanks!

Edit: Sorry, I found another question related to my question. Unfortunately it is still unanswered imdecode-without-temporary-file

edit retag flag offensive close merge delete

Comments

1

just curious, what img type are you decoding ? (iirc, only some of them require a temp file)

berak gravatar imageberak ( 2016-07-12 02:09:36 -0600 )edit
1

Thanks for your answer. Everytime i decode a tiff, a temp file is created. If i decode a jpg no temp file is created.

Delerium gravatar imageDelerium ( 2016-07-12 03:42:30 -0600 )edit

ahh, good to hear. i'll have a look at the src, and try to compile a complete list later..

berak gravatar imageberak ( 2016-07-12 03:44:45 -0600 )edit