解决取消扫描丢图问题;BUG-906

This commit is contained in:
yangjiaxuan 2024-02-27 16:25:13 +08:00
parent fb959e307e
commit 1d91cb3e13
1 changed files with 2 additions and 10 deletions

View File

@ -1100,16 +1100,8 @@ void HGAPI HGSaneDeviceImpl::ThreadFunc(HGThread thread, HGPointer param)
if (readSize != params.bytes_per_line * params.lines) if (readSize != params.bytes_per_line * params.lines)
{ {
free(buffer); free(buffer);
if (p->m_cancelScan) 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 (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; break;
} }
} }