comparison Render.cpp @ 2440:2b10278bc7ac

some more memory access fixed
author Grumpy7
date Thu, 24 Jul 2014 01:10:50 +0200
parents 6d5877899730
children b10125a9c772
comparison
equal deleted inserted replaced
2437:ea7748f4dc60 2440:2b10278bc7ac
740 unsigned int uFreeVideoMem; // [sp+4B8h] [bp-44h]@14 740 unsigned int uFreeVideoMem; // [sp+4B8h] [bp-44h]@14
741 RenderD3D_aux aux; // [sp+4BCh] [bp-40h]@19 741 RenderD3D_aux aux; // [sp+4BCh] [bp-40h]@19
742 IDirect3D3 *pDirect3D3; // [sp+4C4h] [bp-38h]@18 742 IDirect3D3 *pDirect3D3; // [sp+4C4h] [bp-38h]@18
743 int is_there_a_compatible_screen_mode; // [sp+4C8h] [bp-34h]@16 743 int is_there_a_compatible_screen_mode; // [sp+4C8h] [bp-34h]@16
744 RenderD3D_D3DDevDesc v20; // [sp+4CCh] [bp-30h]@1 744 RenderD3D_D3DDevDesc v20; // [sp+4CCh] [bp-30h]@1
745 LPDIRECTDRAW pDirectDraw; // [sp+4F4h] [bp-8h]@4 745 LPDIRECTDRAW pDirectDraw = nullptr; // [sp+4F4h] [bp-8h]@4
746 IDirectDraw4 *pDirectDraw4; // [sp+4F8h] [bp-4h]@7 746 IDirectDraw4 *pDirectDraw4; // [sp+4F8h] [bp-4h]@7
747 747
748 v4 = strlen(lpDriverName); 748 v4 = strlen(lpDriverName);
749 v20.pDriverName = new char[v4 + 1]; 749 v20.pDriverName = new char[v4 + 1];
750 v5 = strlen(lpDevDesc); 750 v5 = strlen(lpDevDesc);
1257 } 1257 }
1258 } 1258 }
1259 v3 = 0; 1259 v3 = 0;
1260 do 1260 do
1261 { 1261 {
1262 free(v1->pAvailableDevices[v3].pDriverName); 1262 delete[] v1->pAvailableDevices[v3].pDriverName;
1263 v1->pAvailableDevices[v3].pDriverName = nullptr; 1263 v1->pAvailableDevices[v3].pDriverName = nullptr;
1264 free(v1->pAvailableDevices[v3].pDeviceDesc); 1264 delete[] v1->pAvailableDevices[v3].pDeviceDesc;
1265 v1->pAvailableDevices[v3].pDeviceDesc = nullptr; 1265 v1->pAvailableDevices[v3].pDeviceDesc = nullptr;
1266 free(v1->pAvailableDevices[v3].pDDraw4DevDesc); 1266 delete[] v1->pAvailableDevices[v3].pDDraw4DevDesc;
1267 v1->pAvailableDevices[v3].pDDraw4DevDesc = nullptr; 1267 v1->pAvailableDevices[v3].pDDraw4DevDesc = nullptr;
1268 free(v1->pAvailableDevices[v3].pDirectDrawGUID); 1268 delete v1->pAvailableDevices[v3].pDirectDrawGUID;
1269 v1->pAvailableDevices[v3].pDirectDrawGUID = nullptr; 1269 v1->pAvailableDevices[v3].pDirectDrawGUID = nullptr;
1270 free(v1->pAvailableDevices[v3].pName); 1270 delete[] v1->pAvailableDevices[v3].pName;
1271 v1->pAvailableDevices[v3].pName = nullptr; 1271 v1->pAvailableDevices[v3].pName = nullptr;
1272 free(v1->pAvailableDevices[v3].pDescription); 1272 delete[] v1->pAvailableDevices[v3].pDescription;
1273 v1->pAvailableDevices[v3].pDescription = nullptr; 1273 v1->pAvailableDevices[v3].pDescription = nullptr;
1274 free(v1->pAvailableDevices[v3].pGUID); 1274 delete v1->pAvailableDevices[v3].pGUID;
1275 v1->pAvailableDevices[v3].pGUID = nullptr; 1275 v1->pAvailableDevices[v3].pGUID = nullptr;
1276 ++v3; 1276 ++v3;
1277 } 1277 }
1278 while ( v3 < 4 ); 1278 while ( v3 < 4 );
1279 free(v1->pAvailableDevices); 1279 delete[] v1->pAvailableDevices;
1280 v1->pAvailableDevices = 0; 1280 v1->pAvailableDevices = 0;
1281 v4 = v1->pViewport; 1281 v4 = v1->pViewport;
1282 if ( v4 ) 1282 if ( v4 )
1283 { 1283 {
1284 v4->Release(); 1284 v4->Release();
8445 else 8445 else
8446 { 8446 {
8447 fclose(this->pFile); 8447 fclose(this->pFile);
8448 for (uint i = 0; i < this->uNumItems; i++) 8448 for (uint i = 0; i < this->uNumItems; i++)
8449 { 8449 {
8450 free(this->pSpriteNames[i]); 8450 delete[] this->pSpriteNames[i];
8451 } 8451 }
8452 } 8452 }
8453 return true; 8453 return true;
8454 } 8454 }
8455 8455