This commit is contained in:
13038267101 2022-10-22 16:18:23 +08:00
commit 219effc0ca
3 changed files with 10 additions and 4 deletions

View File

@ -771,8 +771,8 @@ void hg_scanner::thread_handle_image_process(void)
catch (...) catch (...)
{ {
VLOG_MINI_1(LOG_LEVEL_FATAL, "FATAL: Insufficient memory when proecss image with %d bytes.\n", tiny_buffer->size()); VLOG_MINI_1(LOG_LEVEL_FATAL, "FATAL: Insufficient memory when proecss image with %d bytes.\n", tiny_buffer->size());
stop();
status_ = SCANNER_ERR_INSUFFICIENT_MEMORY; status_ = SCANNER_ERR_INSUFFICIENT_MEMORY;
stop();
break; break;
} }
} }

View File

@ -1498,6 +1498,9 @@ void hg_scanner_239::thread_handle_usb_read(void)
} }
if (user_cancel_) if (user_cancel_)
{ {
if (status_) // thread_handle_image_process maybe call stop() when insufficient memory occurs .
ret = status_;
else
status_ = ret = SCANNER_ERR_USER_CANCELED; status_ = ret = SCANNER_ERR_USER_CANCELED;
//VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "用户取消操作 '%s'\n", hg_scanner_err_name(status_)); //VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "用户取消操作 '%s'\n", hg_scanner_err_name(status_));
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "\347\224\250\346\210\267\345\217\226\346\266\210\346\223\215\344\275\234 '%s'\n", hg_scanner_err_name(status_)); VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "\347\224\250\346\210\267\345\217\226\346\266\210\346\223\215\344\275\234 '%s'\n", hg_scanner_err_name(status_));

View File

@ -1373,8 +1373,11 @@ void hg_scanner_439::thread_handle_usb_read(void)
} }
if (user_cancel_) if (user_cancel_)
{ {
if (status_) // thread_handle_image_process maybe call stop() when insufficient memory occurs .
ret = status_;
else
status_ = ret = SCANNER_ERR_USER_CANCELED; status_ = ret = SCANNER_ERR_USER_CANCELED;
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "用户取消操作 '%s'\n", hg_scanner_err_name(status_)); VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "\347\224\250\346\210\267\345\217\226\346\266\210\346\223\215\344\275\234 '%s'\n", hg_scanner_err_name(status_));
break; break;
} }
if (count == 0) if (count == 0)