small hack to handle disablesource called from diff threads for #16

This commit is contained in:
soukoku
2014-08-31 09:01:38 -04:00
parent f073bc6b65
commit 41d821a9d5
3 changed files with 28 additions and 13 deletions

View File

@@ -118,9 +118,9 @@ namespace NTwain.Internals
} while (rc == ReturnCode.Success && pending.Count != 0);
// some poorly written scanner drivers return failure on EndXfer so also check for pending count now
// some poorly written scanner drivers return failure on EndXfer so also check for pending count now.
// this may break with other sources but we'll see
if (pending.Count == 0)
if (pending.Count == 0 && session.State > 5)
{
session.ChangeState(5, true);
session.DisableSource();