# HG changeset patch # User zipi # Date 1369573189 -3600 # Node ID c59ac5ea63f5c16de87d1601d75272b08df0e252 # Parent 38890b8385e4a8d478c55a4834fff4f009353ccc * stru154::GetFacePlane mistake fixed * messing with memory leaks diff -r 38890b8385e4 -r c59ac5ea63f5 Allocator.cpp --- a/Allocator.cpp Sun May 26 14:13:43 2013 +0400 +++ b/Allocator.cpp Sun May 26 13:59:49 2013 +0100 @@ -22,6 +22,10 @@ void *Allocator::AllocNamedChunk(const void *pPrevPtrValue, unsigned int uSize, const char *pName) { + if ( pPrevPtrValue && !aborting_app ) + AbortWithError(); + if (!uSize) + return 0; return malloc(uSize); /* //Allocator *v4; // esi@1 diff -r 38890b8385e4 -r c59ac5ea63f5 Game.cpp --- a/Game.cpp Sun May 26 14:13:43 2013 +0400 +++ b/Game.cpp Sun May 26 13:59:49 2013 +0100 @@ -769,6 +769,7 @@ if (pMouse) pMouse->Deactivate(); + delete pRenderer; pAudioPlayer->Release();//error pNew_LOD->FreeSubIndexAndIO(); pGames_LOD->FreeSubIndexAndIO(); diff -r 38890b8385e4 -r c59ac5ea63f5 Render.cpp --- a/Render.cpp Sun May 26 14:13:43 2013 +0400 +++ b/Render.cpp Sun May 26 13:59:49 2013 +0100 @@ -11019,7 +11019,7 @@ while ( v2 < (signed int)v1->uNumItems ); } } - return 1; + return true; } //----- (00452347) -------------------------------------------------------- diff -r 38890b8385e4 -r c59ac5ea63f5 Texture.cpp --- a/Texture.cpp Sun May 26 14:13:43 2013 +0400 +++ b/Texture.cpp Sun May 26 13:59:49 2013 +0100 @@ -363,6 +363,7 @@ void *Texture::UnzipPalette() { Texture *v1; // esi@1 + void *v2; // edi@1 Texture *pSource; // [sp+0h] [bp-4h]@1 @@ -382,10 +383,13 @@ if (pBits & 0x0400) { - pAllocator->FreeChunk(pLevelOfDetail0_prolly_alpha_mask); + __debugbreak(); + } + + pAllocator->FreeChunk(pLevelOfDetail0_prolly_alpha_mask); pAllocator->FreeChunk(pPalette16); pAllocator->FreeChunk(pPalette24); - } + pLevelOfDetail0_prolly_alpha_mask = nullptr; pLevelOfDetail1 = nullptr; diff -r 38890b8385e4 -r c59ac5ea63f5 mm7_4.cpp --- a/mm7_4.cpp Sun May 26 14:13:43 2013 +0400 +++ b/mm7_4.cpp Sun May 26 13:59:49 2013 +0100 @@ -3826,7 +3826,7 @@ v9 = &pVertices->pVertices[pFace->pVertexIDs[i]]; v12 = &pVertices->pVertices[pFace->pVertexIDs[i + 1]]; v17 = &pVertices->pVertices[pFace->pVertexIDs[i + 2]]; - + i++; v1.x = v12->x - v9->x; v26 = v17->x - v12->x; v1.y = v12->y - v9->y;