mirror of https://github.com/status-im/qzxing.git
Cancel video frame processor thread in when destructing QZXingFilterRunnable instead of QZXingFilter as the thread uses the instanse of QZXingFilterRunnable. Solution suggested by @ #176
This commit is contained in:
parent
e444138924
commit
14577acc92
|
@ -53,10 +53,6 @@ QZXingFilter::QZXingFilter(QObject *parent)
|
|||
|
||||
QZXingFilter::~QZXingFilter()
|
||||
{
|
||||
if(!processThread.isFinished()) {
|
||||
processThread.cancel();
|
||||
processThread.waitForFinished();
|
||||
}
|
||||
}
|
||||
|
||||
void QZXingFilter::handleDecodingStarted()
|
||||
|
@ -90,6 +86,12 @@ QZXingFilterRunnable::QZXingFilterRunnable(QZXingFilter * filter)
|
|||
}
|
||||
QZXingFilterRunnable::~QZXingFilterRunnable()
|
||||
{
|
||||
if(filter != ZXING_NULLPTR && !filter->processThread.isFinished())
|
||||
{
|
||||
filter->processThread.cancel();
|
||||
filter->processThread.waitForFinished();
|
||||
}
|
||||
|
||||
filter = ZXING_NULLPTR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue