diff --git a/sane/scanner.cpp b/sane/scanner.cpp index 9fe3357..82e45d6 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -823,6 +823,7 @@ void scanner::scan_done(void) // on_ui_event(SANE_EVENT_SCAN_FINISHED, (void*)SANE_EVENT_SCAN_FINISHED); //} // is_scanning_ = false; + is_in_working_thread_ = false; } // IRef @@ -1639,7 +1640,7 @@ int scanner::thread_start(void) ui_notify(SANE_EVENT_SCAN_FINISHED, (void *)hg_scanner_err_description(ret), ret); } - else + else if(!is_in_working_thread_) #endif { scan_over_ = true; @@ -3746,7 +3747,7 @@ int scanner::handle_device_event(int ev_code, void* data, unsigned int* len) } else { - is_in_working_thread_ = false; + //is_in_working_thread_ = false; err_ = *len; scan_over_ = true; scan_msg_ = data ? (char*)data : "OK";