Fixed wrong pointer passed to unlock method.

This commit is contained in:
soukoku
2015-01-03 12:58:37 -05:00
parent 844f84e259
commit d7a2bebe2a
4 changed files with 17 additions and 9 deletions

View File

@@ -156,7 +156,8 @@ namespace NTwain.Internals
// data here is allocated by source so needs to use shared mem calls
if (lockedPtr != IntPtr.Zero)
{
PlatformInfo.Current.MemoryManager.Unlock(lockedPtr);
//PlatformInfo.Current.MemoryManager.Unlock(lockedPtr);
PlatformInfo.Current.MemoryManager.Unlock(dataPtr);
lockedPtr = IntPtr.Zero;
}
if (dataPtr != IntPtr.Zero)
@@ -222,7 +223,8 @@ namespace NTwain.Internals
// data here is allocated by source so needs to use shared mem calls
if (lockedPtr != IntPtr.Zero)
{
PlatformInfo.Current.MemoryManager.Unlock(lockedPtr);
//PlatformInfo.Current.MemoryManager.Unlock(lockedPtr);
PlatformInfo.Current.MemoryManager.Unlock(dataPtr);
lockedPtr = IntPtr.Zero;
}
if (dataPtr != IntPtr.Zero)
@@ -300,7 +302,8 @@ namespace NTwain.Internals
{
if (lockPtr != IntPtr.Zero)
{
PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
PlatformInfo.Current.MemoryManager.Unlock(xferInfo.Memory.TheMem);
//PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
}
}
}
@@ -376,7 +379,8 @@ namespace NTwain.Internals
{
if (lockPtr != IntPtr.Zero)
{
PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
PlatformInfo.Current.MemoryManager.Unlock(xferInfo.Memory.TheMem);
//PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
}
}
outStream.Write(buffer, 0, buffer.Length);