Author Topic: memory leak in YM2151 (and other things)  (Read 8177 times)

kev

  • Guest
memory leak in YM2151 (and other things)
« 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.



kev

  • Guest
Re: memory leak in YM2151
« Reply #1 on: September 20, 2008, 10:18:47 AM »
Here is a tracklist.cpp that works with unicode and non unicode.

kev

  • Guest
Re: memory leak in YM2151 (and other things)
« Reply #2 on: September 20, 2008, 10:28:03 AM »
Anyone else having problems with Visual C++ builds and TMNT?


kev

  • Guest
Re: memory leak in YM2151 (and other things)
« Reply #3 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));

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: memory leak in YM2151 (and other things)
« Reply #4 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! :)
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

kev

  • Guest
Re: memory leak in YM2151 (and other things)
« Reply #5 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. :)

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: memory leak in YM2151 (and other things)
« Reply #6 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?
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

kev

  • Guest
Re: memory leak in YM2151 (and other things)
« Reply #7 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. :)