DXUTDialog: Free Heap block f6f608 modified at f6f69c after it was freed

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • DXUTDialog: Free Heap block f6f608 modified at f6f69c after it was freed

      Hi

      I've been working on all the tips provided in Game Coding Complete 2nd ed. To get all the the concepts 100% I've been gradually implementing the classes from the book. It's been working out pretty good until now, but I've hit a snag after testing the CMessageBox code.

      When I show a CMessageBox on WM_CLOSE (Exit confirmation) the first time and hit "No" everything is ok, but the second time windows triggers a breakpoint and I get this error:

      HEAP[GameTest.exe]: HEAP: Free Heap block f6f608 modified at f6f69c after it was freed.

      There are no more errors after this one and everything seems to work. If this is debugged in release mode the text is garbled.

      I've tracked the problem to the DXUTDialog class and the SetTexture(...) function shown below:

      for( UINT i = m_Textures.GetSize(); i <= index; i++ )
      {
      m_Textures.Add( -1 );
      }

      the lastest point before digging into C/C++ includes is this:

      template<typename TYPE> HRESULT CGrowableArray <TYPE>::Add( const TYPE& value )
      {
      HRESULT hr;
      if( FAILED( hr = SetSizeInternal( m_nSize + 1 ) ) )
      return hr;

      My code is basically the same as the source from the book (latest version) and I don't think I've left anything out. Not that I can rule this out though. hehe

      Hope one of you guys can help me.

      Edit: It seems that when I add a SoundProcess to the ProcessManager or create my font class the font in the message box gets scrambled or the game breaks with the heap corruption error.

      The post was edited 1 time, last by Corvwyn ().

    • RE: DXUTDialog: Free Heap block f6f608 modified at f6f69c after it was freed

      Gross - what version of DirectX are you using? I'll bet this might be a recent incompatibility with DX10....the original GCC source code was written to DX9....

      It might also have something to do with a more recent version of Boost C++....which version of that are you using?
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • I'm using DirectX 9 under Vista x64, but I'm using the DXUT provided in The newest (August) DirectX SDK. So the DXUT framework supports both DX9 and DX10.

      I'm also using the newest boost libraries 1.36.0

      Sometimes SC_CLOSE is disabled as well, so I have to hit ESC to exit the application.

      I was thinking of reverting to the boost and DXUT version you use in your book, just to see if that's the problem. I just have to rename a lot of function calls since microsoft seems to enjoy renaming them.

      It's usually around this location in the heap starting with 3XXXXXX:

      HEAP[GameTest.exe]: HEAP: Free Heap block 3b048c8 modified at 3b0495c after it was freed

      The post was edited 5 times, last by Corvwyn ().

    • I've now tested using boost 1.31.0 and the DXUT version used in the book. The same thing happened. I am still using the DirectX August 2008 SDK though, if that matters.

      Another strange thing is that the error always occur the second time the CMessageBox is created, not on the third, fourth... It doesn't always break either, but the text on the second CMessageBox is always scrambled... *scratch head*