Welcome!

Final Burn Neo => FBN Development => Topic started by: kev on September 20, 2008, 08:47:42 AM

Title: memory leak in YM2151 (and other things)
Post by: kev on September 20, 2008, 08:47:42 AM
Should be:

void BurnYM2151Exit()
{
   YM2151Shutdown();

   if (pBuffer!=NULL)
   {
      free(pBuffer);
   }
}

 


EDIT: There is a leak somewhere but the above fix doesnt help in all cases so I am investigating. :)

Also, I have run into problems with tracklist.cpp when building in Visual Studio 2008, trying to fix the last one and will post so someone can test under gcc.


Title: Re: memory leak in YM2151
Post by: kev on September 20, 2008, 10:18:47 AM
Here is a tracklist.cpp that works with unicode and non unicode.
Title: Re: memory leak in YM2151 (and other things)
Post by: kev on September 20, 2008, 10:28:03 AM
Anyone else having problems with Visual C++ builds and TMNT?

Title: Re: memory leak in YM2151 (and other things)
Post by: kev on September 20, 2008, 11:11:23 AM
fixes for slight typo's in these two interfaces e.g.

Code: [Select]
memset(m6809CPUContext, 0, num * sizeof(DozeContext));
Title: Re: memory leak in YM2151 (and other things)
Post by: Barry Harris on September 20, 2008, 11:17:20 AM
fixes for slight typo's in these two interfaces e.g.

Code: [Select]
memset(m6809CPUContext, 0, num * sizeof(DozeContext));

I thought I'd caught them! - Must have forgot to change them. :)

For tmnt - it works fine in VC builds for me - does my current released build work ok for you?

For free() - I actually thought it was safe to call even if malloc had failed or even hasn't been called - I could be wrong but quite a bit will probably need to be changed if I am! :)
Title: Re: memory leak in YM2151 (and other things)
Post by: kev on September 20, 2008, 11:25:14 AM
It's definately breaking when calling the free(pBuffer) line, but only in some drivers, e.g. MIA.

And yeah, TMNT works fine in your builds. Very odd. :)
Title: Re: memory leak in YM2151 (and other things)
Post by: Barry Harris on September 20, 2008, 11:44:19 AM
It's definately breaking when calling the free(pBuffer) line, but only in some drivers, e.g. MIA.

And yeah, TMNT works fine in your builds. Very odd. :)

What environment are you using? I see very few crashes now - certainly in non-WIP drivers. We might need to tidy up to support non-Windoze?
Title: Re: memory leak in YM2151 (and other things)
Post by: kev on September 20, 2008, 11:52:42 AM
Visual studio 2008, the IDE version, not the command line version.

Also, there are a few other things it chokes on when building but I have not had enough time to track them down and fix them properly yet. :)