TODO - The Windows Geschischte

Sebastian Pipping webmaster at hartwork.org
Thu Jul 20 18:29:06 CEST 2006


Lukáš Lalinský wrote:
> Sebastian Pipping wrote:
>> there is another thing about this name variable:
>> FilePrivate is constructed from astring that was allocated somewhere
>> outside but frees it in the destructor using "free". This causes
>> trouble at least when the original memory was allocated using
>> "new char[..]". I remember a rule of thumb to never mix
>> new/free and malloc/delete. I think working with a copy would be
>> a good way to solve this.
> 
> It already works with a copy. The string is allocated in File::File by strdup.

----------------------------------------------
Sorry, I overlooked that.

Maybe moving the strdup call form File to
FilePrivate would be a good idea so
both strdup and free are at the same place.


Sebastian


-- 
Sebastian Pipping
http://www.hartwork.org/


More information about the taglib-devel mailing list