Remove possible cross binary boundary delete

This commit is contained in:
tsuda.kageyu@gmail.com 2012-08-23 11:09:22 +09:00
parent e86e5f906b
commit eb63ee8ec6
2 changed files with 6 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,8 @@ 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, default ISO-8859-1 handler
* is restored.
*
* \see StringHandler
*/