FramesData: Don't leak allocated frames, and remove unused functions
Valgrind report: ``` 14,960 (11,544 direct, 3,416 indirect) bytes in 37 blocks are definitely lost in loss record 20,483 of 20,540 at 0x4837DEF: operator new(unsigned long) (vg_replace_malloc.c:334) by 0xC06963: rtengine::FramesData::FramesData(Glib::ustring const&, std::unique_ptr<rtengine::RawMetaDataLocation, std::default_delete<rtengine::RawMetaDataLocation> >, bool) (imagedata.cc:1121) by 0xBD774F: rtengine::DFManager::addFileInfo(Glib::ustring const&, bool) (dfmanager.cc:380) by 0xBD6E90: rtengine::DFManager::init(Glib::ustring) (dfmanager.cc:303) by 0xC3EC5D: rtengine::init(rtengine::Settings const*, Glib::ustring, Glib::ustring, bool) [clone ._omp_fn.0] (init.cc:93) by 0x897CABD: gomp_thread_start (team.c:120) by 0x89B7A9C: start_thread (in /usr/lib/libpthread-2.28.so) by 0x8ACCB22: clone (in /usr/lib/libc-2.28.so) ```
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#define __IMAGEDATA_H__
|
||||
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
#include "rawimage.h"
|
||||
#include <string>
|
||||
#include <glibmm.h>
|
||||
@@ -89,7 +90,7 @@ public:
|
||||
class FramesData : public FramesMetaData {
|
||||
private:
|
||||
// frame's root IFD, can be a file root IFD or a SUB-IFD
|
||||
std::vector<FrameData*> frames;
|
||||
std::vector<std::unique_ptr<FrameData>> frames;
|
||||
// root IFD in the file
|
||||
std::vector<rtexif::TagDirectory*> roots;
|
||||
IptcData* iptc;
|
||||
@@ -102,7 +103,6 @@ public:
|
||||
void setDCRawFrameCount (unsigned int frameCount);
|
||||
unsigned int getRootCount () const;
|
||||
unsigned int getFrameCount () const;
|
||||
FrameData *getFrameData (unsigned int frame) const;
|
||||
bool getPixelShift () const;
|
||||
bool getHDR (unsigned int frame = 0) const;
|
||||
std::string getImageType (unsigned int frame) const;
|
||||
|
Reference in New Issue
Block a user