taglib/taglib — pull request #254 by TsudaKageyu (2013-07-06 15:43:25+00:00)
Title: Removed the risk of new/delete across binary boundaries in FLAC::File

Currently, ```FLAC::File::addPicture()``` accepts a ```FLAC::Picture``` object created outside TagLib and delete it unless it is removed before the ```File``` object is destructed. It can lead programs to crash. It is similar to the issue #253.
In order to remove the risk, I have modified ```FLAC::File``` class always to perform new/delete operations of ```FLAC::Picture``` internally.

The API is changed a little. Current usage of ```FLAC::File::addPicture()``` is like this:
```
FLAC::File f(...);
...
FLAC::Picture *newpic = new FLAC::Picture(...);
newpic->setType(FLAC::Picture::BackCover);
...
f.addPicture(newpic);
```

I have changed it like this:
```
FLAC::File f(...);
...
FLAC::Picture *newpic = f.addPicture(...); // Creates and returns a Picture object.
newpic->setType(FLAC::Picture::BackCover);
```
The concrete examples are shown in ```tests/test_flac.cpp```.