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:
@@ -809,11 +809,6 @@ unsigned int FramesData::getFrameCount () const
|
||||
return dcrawFrameCount ? dcrawFrameCount : frames.size();
|
||||
}
|
||||
|
||||
FrameData *FramesData::getFrameData (unsigned int frame) const
|
||||
{
|
||||
return frames.empty() || frame >= frames.size() ? nullptr : frames.at(frame);
|
||||
}
|
||||
|
||||
bool FramesData::getPixelShift () const
|
||||
{
|
||||
// So far only Pentax and Sony provide multi-frame Pixel Shift files.
|
||||
@@ -1118,9 +1113,7 @@ FramesData::FramesData (const Glib::ustring& fname, std::unique_ptr<RawMetaDataL
|
||||
|
||||
// creating FrameData
|
||||
for (auto currFrame : exifManager.frames) {
|
||||
FrameData* fd = new FrameData(currFrame, currFrame->getRoot(), roots.at(0));
|
||||
|
||||
frames.push_back(fd);
|
||||
frames.push_back(std::unique_ptr<FrameData>(new FrameData(currFrame, currFrame->getRoot(), roots.at(0))));
|
||||
}
|
||||
for (auto currRoot : roots) {
|
||||
rtexif::Tag* t = currRoot->getTag(0x83BB);
|
||||
@@ -1142,8 +1135,7 @@ FramesData::FramesData (const Glib::ustring& fname, std::unique_ptr<RawMetaDataL
|
||||
exifManager.parseJPEG ();
|
||||
roots = exifManager.roots;
|
||||
for (auto currFrame : exifManager.frames) {
|
||||
FrameData* fd = new FrameData(currFrame, currFrame->getRoot(), roots.at(0));
|
||||
frames.push_back(fd);
|
||||
frames.push_back(std::unique_ptr<FrameData>(new FrameData(currFrame, currFrame->getRoot(), roots.at(0))));
|
||||
}
|
||||
rewind (exifManager.f); // Not sure this is necessary
|
||||
iptc = iptc_data_new_from_jpeg_file (exifManager.f);
|
||||
@@ -1161,9 +1153,7 @@ FramesData::FramesData (const Glib::ustring& fname, std::unique_ptr<RawMetaDataL
|
||||
|
||||
// creating FrameData
|
||||
for (auto currFrame : exifManager.frames) {
|
||||
FrameData* fd = new FrameData(currFrame, currFrame->getRoot(), roots.at(0));
|
||||
|
||||
frames.push_back(fd);
|
||||
frames.push_back(std::unique_ptr<FrameData>(new FrameData(currFrame, currFrame->getRoot(), roots.at(0))));
|
||||
}
|
||||
for (auto currRoot : roots) {
|
||||
rtexif::Tag* t = currRoot->getTag(0x83BB);
|
||||
|
Reference in New Issue
Block a user