mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-16 12:58:31 +00:00
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()
|
QZXingFilter::~QZXingFilter()
|
||||||
{
|
{
|
||||||
if(!processThread.isFinished()) {
|
|
||||||
processThread.cancel();
|
|
||||||
processThread.waitForFinished();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZXingFilter::handleDecodingStarted()
|
void QZXingFilter::handleDecodingStarted()
|
||||||
@ -90,6 +86,12 @@ QZXingFilterRunnable::QZXingFilterRunnable(QZXingFilter * filter)
|
|||||||
}
|
}
|
||||||
QZXingFilterRunnable::~QZXingFilterRunnable()
|
QZXingFilterRunnable::~QZXingFilterRunnable()
|
||||||
{
|
{
|
||||||
|
if(filter != ZXING_NULLPTR && !filter->processThread.isFinished())
|
||||||
|
{
|
||||||
|
filter->processThread.cancel();
|
||||||
|
filter->processThread.waitForFinished();
|
||||||
|
}
|
||||||
|
|
||||||
filter = ZXING_NULLPTR;
|
filter = ZXING_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user