CoreWLan: wait for scan thread to finish
If the scan thread is running when QCoreWlanEngine is destroyed it will access stale data and cause a crash. Task-number: QTBUG-36000 Change-Id: I8cc9e39a3f7d4736da39e8b31f6963db35318f19 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>bb10
parent
518d874bc8
commit
71006cf04c
|
|
@ -419,6 +419,8 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
|
|||
|
||||
QCoreWlanEngine::~QCoreWlanEngine()
|
||||
{
|
||||
scanThread->wait(5000);
|
||||
|
||||
while (!foundConfigurations.isEmpty())
|
||||
delete foundConfigurations.takeFirst();
|
||||
[listener remove];
|
||||
|
|
|
|||
|
|
@ -404,6 +404,8 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
|
|||
|
||||
QCoreWlanEngine::~QCoreWlanEngine()
|
||||
{
|
||||
scanThread->wait(5000);
|
||||
|
||||
while (!foundConfigurations.isEmpty())
|
||||
delete foundConfigurations.takeFirst();
|
||||
[listener remove];
|
||||
|
|
|
|||
Loading…
Reference in New Issue