#634 Locking error on windows when updating a TIFF file with MemoryMapping enabled

This commit is contained in:
Robin Mills 2009-05-17 23:41:43 +00:00
parent c2c1673b7a
commit 61ca4b9b20
2 changed files with 5 additions and 7 deletions

View File

@ -174,9 +174,9 @@ int munmap(void *start, size_t length)
return -1;
}
UnmapViewOfFile( g_mmapInfos[g_curMMapInfos].start );
CloseHandle( g_mmapInfos[g_curMMapInfos].hMap );
CloseHandle( g_mmapInfos[g_curMMapInfos].hFile );
UnmapViewOfFile( g_mmapInfos[i].start );
CloseHandle( g_mmapInfos[i].hMap );
CloseHandle( g_mmapInfos[i].hFile );
EnterCriticalSection( &cs );
for( j = i + 1; j < g_curMMapInfos; j++ ) {

View File

@ -77,7 +77,6 @@ namespace Exiv2 {
FileIo::~FileIo()
{
munmap();
close();
}
@ -368,9 +367,7 @@ namespace Exiv2 {
int FileIo::open(const std::string& mode)
{
if (fp_ != 0) {
std::fclose(fp_);
}
close();
openMode_ = mode;
opMode_ = opSeek;
@ -386,6 +383,7 @@ namespace Exiv2 {
int FileIo::close()
{
munmap();
if (fp_ != 0) {
std::fclose(fp_);
fp_= 0;