Frees the structure for MPQ file
| 1553 | |
| 1554 | // Frees the structure for MPQ file |
| 1555 | void FreeFileHandle(TMPQFile *& hf) |
| 1556 | { |
| 1557 | if(hf != NULL) |
| 1558 | { |
| 1559 | // If we have patch file attached to this one, free it first |
| 1560 | if(hf->hfPatch != NULL) |
| 1561 | FreeFileHandle(hf->hfPatch); |
| 1562 | |
| 1563 | // Then free all buffers allocated in the file structure |
| 1564 | if(hf->pbFileData != NULL) |
| 1565 | STORM_FREE(hf->pbFileData); |
| 1566 | if(hf->pPatchInfo != NULL) |
| 1567 | STORM_FREE(hf->pPatchInfo); |
| 1568 | if(hf->SectorOffsets != NULL) |
| 1569 | STORM_FREE(hf->SectorOffsets); |
| 1570 | if(hf->SectorChksums != NULL) |
| 1571 | STORM_FREE(hf->SectorChksums); |
| 1572 | if(hf->pbFileSector != NULL) |
| 1573 | STORM_FREE(hf->pbFileSector); |
| 1574 | if(hf->pStream != NULL) |
| 1575 | FileStream_Close(hf->pStream); |
| 1576 | STORM_FREE(hf); |
| 1577 | hf = NULL; |
| 1578 | } |
| 1579 | } |
| 1580 | |
| 1581 | // Frees the MPQ archive |
| 1582 | void FreeArchiveHandle(TMPQArchive *& ha) |
no test coverage detected