#634 Locking error on windows when updating a TIFF file with MemoryMapping enabled
This commit is contained in:
parent
c2c1673b7a
commit
61ca4b9b20
@ -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++ ) {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user