mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
unmap file when throw exception
This commit is contained in:
parent
f52251d640
commit
79e2f7c098
|
@ -160,7 +160,10 @@ char * Reader::getBlock( uint32_t address, vector< char > & chunk )
|
||||||
|
|
||||||
if( uncompress( (unsigned char *)&chunk.front(), &decompressedLength, chunkDataBytes, compressedSize ) != Z_OK
|
if( uncompress( (unsigned char *)&chunk.front(), &decompressedLength, chunkDataBytes, compressedSize ) != Z_OK
|
||||||
|| decompressedLength != chunk.size() )
|
|| decompressedLength != chunk.size() )
|
||||||
|
{
|
||||||
|
file.unmap( chunkDataBytes );
|
||||||
throw exFailedToDecompressChunk();
|
throw exFailedToDecompressChunk();
|
||||||
|
}
|
||||||
|
|
||||||
file.unmap( chunkDataBytes );
|
file.unmap( chunkDataBytes );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue