解决国产系统点击取消扫描报io错误的问题;BUG-903

This commit is contained in:
yangjiaxuan 2024-02-21 11:14:07 +08:00
parent bd15a99d11
commit 9524f9fcc2
1 changed files with 10 additions and 2 deletions

View File

@ -1104,8 +1104,16 @@ void HGAPI HGSaneDeviceImpl::ThreadFunc(HGThread thread, HGPointer param)
if (readSize != params.bytes_per_line * params.lines)
{
free(buffer);
if (NULL != p->m_scanNotify)
p->m_scanNotify((int)SANE_EVENT_SCAN_FINISHED, (void*)saneAPI.sane_strstatus_api(SANE_STATUS_IO_ERROR), (int)SANE_STATUS_IO_ERROR);
if (p->m_cancelScan)
{
if (NULL != p->m_scanNotify)
p->m_scanNotify((int)SANE_EVENT_SCAN_FINISHED, (void*)saneAPI.sane_strstatus_api(SANE_STATUS_CANCELLED), (int)SANE_STATUS_CANCELLED);
}
else
{
if (NULL != p->m_scanNotify)
p->m_scanNotify((int)SANE_EVENT_SCAN_FINISHED, (void*)saneAPI.sane_strstatus_api(SANE_STATUS_IO_ERROR), (int)SANE_STATUS_IO_ERROR);
}
break;
}
}