APE file not destroyed when Fileref set to NULL
Michael Pyne
mpyne at kde.org
Mon Jul 8 23:07:23 UTC 2013
On Mon, July 8, 2013 20:17:15 Brett Hoyle wrote:
> Bool GetInfo(LPTSTR szSource)
> {
> fileRef = TagLib::FileRef(szSource, 1, TagLib::AudioProperties::Fast);
>
> if( !fileRef.isNull() )
>
> {
>
> if(apeFile = dynamic_cast<TagLib::APE::File *>( fileRef.file() ))
> {
> DoStuff();
> }
>
> ...
>
> if(apeFile)
> {
> if(apeFile->APETag()) <<Access violation for files after ape that are
> not ape file
> {
> DoAPEStuff();
> }
> }
> Should I be setting apeFile to NULL myself?
Well, the *pseudo-code* looks to be correct, assuming that dynamic_cast<> is
returning null for objects that are not APE::File*. Is there anywhere else in
the actual code where apeFile is being assigned?
Of course, you can try it anyways and reset all static members when you go
into your function and see if that fixes it. If so there's probably something
else going on within the rest of the code.
Regards,
- Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20130708/2fef7531/attachment.sig>
More information about the taglib-devel
mailing list