mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
TestId3v2FrameFactory: Fix memory leak
The frames in a frameList() copy were not deleted because it had the autoDelete property active. However, removed frames cannot be auto deleted. Using setAutoDelete() affects the source of the copy, which has to be investigated further.
This commit is contained in:
@ -131,9 +131,9 @@ public:
|
||||
auto f = std::unique_ptr<File>(createFileWithDefaultFactory(fileName));
|
||||
CPPUNIT_ASSERT(f->isValid());
|
||||
ID3v2::Tag *tag = getID3v2Tag(*f);
|
||||
const ID3v2::FrameList frames = tag->frameList();
|
||||
for(const auto &frame : frames) {
|
||||
tag->removeFrame(frame, false);
|
||||
ID3v2::FrameList frames = tag->frameList();
|
||||
for(auto it = frames.begin(); it != frames.end(); it = frames.erase(it)) {
|
||||
tag->removeFrame(*it);
|
||||
}
|
||||
tag->setArtist("An artist");
|
||||
tag->setTitle("A title");
|
||||
|
Reference in New Issue
Block a user