mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -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:
parent
bd06012b02
commit
3f11e0ae2f
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user