From 3ffda0a0c3546e1d6ac6e030f603d203b21ef634 Mon Sep 17 00:00:00 2001 From: "mo1027728827@qq.com" Date: Tue, 7 Jun 2022 18:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BE=E7=89=87=E6=B8=85?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 3 ++- hgdriver/hgdev/hg_scanner_300.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 3577284..e454207 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -699,7 +699,6 @@ void hg_scanner::thread_handle_image_process(void) void hg_scanner::working_begin(void*) { - final_imgs_.clear(); final_img_index_ = 0; notify_ui_working_status(STATU_DESC_SCAN_WORKING, SANE_EVENT_WORKING, SCANNER_ERR_OK); VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "[%s] scanning ...\n", hg_log::current_time().c_str()); @@ -707,6 +706,8 @@ void hg_scanner::working_begin(void*) void hg_scanner::working_done(void*) { imgs_.Clear(); + if(user_cancel_) + final_imgs_.clear(); switch (status_) { diff --git a/hgdriver/hgdev/hg_scanner_300.cpp b/hgdriver/hgdev/hg_scanner_300.cpp index f20b499..648ef36 100644 --- a/hgdriver/hgdev/hg_scanner_300.cpp +++ b/hgdriver/hgdev/hg_scanner_300.cpp @@ -420,7 +420,7 @@ int hg_scanner_300::stop(void) LOG_INFO(LOG_LEVEL_DEBUG_INFO,"stop status is busy\r\n"); std::this_thread::sleep_for(std::chrono::milliseconds(2000)); } - //user_cancel_ = true; + user_cancel_ = true; if (ret == SCANNER_ERR_OK) { status_ = SCANNER_ERR_DEVICE_STOPPED;