1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

core(persistence): fix resource leaks - force closing files

backporting commit 673eb2b006
This commit is contained in:
Alexander Alekhin
2020-03-24 08:58:30 +00:00
parent a28a520c7f
commit c920b45fb8
3 changed files with 96 additions and 27 deletions
+2 -2
View File
@@ -251,10 +251,10 @@ void icvClose( CvFileStorage* fs, cv::String* out )
else if ( fs->fmt == CV_STORAGE_FORMAT_JSON )
icvPuts( fs, "}\n" );
}
icvCloseFile(fs);
}
icvCloseFile(fs);
if( fs->outbuf && out )
{
*out = cv::String(fs->outbuf->begin(), fs->outbuf->end());