diff --git a/GScan200.cpp b/GScan200.cpp index 7aca0d5..e52e875 100644 --- a/GScan200.cpp +++ b/GScan200.cpp @@ -5,7 +5,7 @@ #include "opencv2/opencv.hpp" #include "twain.h" #include "device_common.h" -#include "GDevice.h"; +#include "GDevice.h" GScan200::GScan200() { @@ -116,9 +116,11 @@ bool GScan200::Get_IsImageQueueEmpty() void GScan200::reset() { - m_dev->stop(); - this_thread::sleep_for(chrono::milliseconds(200)); - m_pImages.clear(); + if (m_dev) { + m_dev->stop(); + this_thread::sleep_for(chrono::milliseconds(200)); + m_pImages.clear(); + } } void GScan200::setdecodepixtype(int twpixtype)