Merge remote-tracking branch 'TsudaKageyu/cross-border-delete'

This commit is contained in:
Lukáš Lalinský
2012-08-23 10:51:47 +02:00
2 changed files with 9 additions and 4 deletions

View File

@ -194,10 +194,10 @@ void ID3v1::Tag::setTrack(uint i)
void ID3v1::Tag::setStringHandler(const StringHandler *handler)
{
if(TagPrivate::stringHandler != &defaultStringHandler)
delete TagPrivate::stringHandler;
TagPrivate::stringHandler = handler;
if (handler)
TagPrivate::stringHandler = handler;
else
TagPrivate::stringHandler = &defaultStringHandler;
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -154,6 +154,11 @@ namespace TagLib {
/*!
* Sets the string handler that decides how the ID3v1 data will be
* converted to and from binary data.
* If the parameter \a handler is null, the previous handler is
* released and default ISO-8859-1 handler is restored.
*
* \note The caller is responsible for deleting the previous handler
* as needed after it is released.
*
* \see StringHandler
*/