From b4b69ae484db98ae7e8f6baf302eb215d43122c4 Mon Sep 17 00:00:00 2001 From: Berke Date: Thu, 14 Jul 2022 16:45:47 +0300 Subject: [PATCH] release png,jpeg resources in destructor --- modules/imgcodecs/src/grfmt_jpeg.cpp | 4 ---- modules/imgcodecs/src/grfmt_png.cpp | 4 ---- 2 files changed, 8 deletions(-) diff --git a/modules/imgcodecs/src/grfmt_jpeg.cpp b/modules/imgcodecs/src/grfmt_jpeg.cpp index 060a4c4901..506cebdf49 100644 --- a/modules/imgcodecs/src/grfmt_jpeg.cpp +++ b/modules/imgcodecs/src/grfmt_jpeg.cpp @@ -260,9 +260,6 @@ bool JpegDecoder::readHeader() } } - if( !result ) - close(); - return result; } @@ -512,7 +509,6 @@ bool JpegDecoder::readData( Mat& img ) } } - close(); return result; } diff --git a/modules/imgcodecs/src/grfmt_png.cpp b/modules/imgcodecs/src/grfmt_png.cpp index 9e1a2d4c71..388a3fcaf4 100644 --- a/modules/imgcodecs/src/grfmt_png.cpp +++ b/modules/imgcodecs/src/grfmt_png.cpp @@ -214,9 +214,6 @@ bool PngDecoder::readHeader() } } - if( !result ) - close(); - return result; } @@ -304,7 +301,6 @@ bool PngDecoder::readData( Mat& img ) } } - close(); return result; }