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
Dyami Caliri 2014-05-07 16:36:04 -07:00 committed by The Qt Project
parent 518d874bc8
commit 71006cf04c
2 changed files with 4 additions and 0 deletions

View File

@ -419,6 +419,8 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
QCoreWlanEngine::~QCoreWlanEngine()
{
scanThread->wait(5000);
while (!foundConfigurations.isEmpty())
delete foundConfigurations.takeFirst();
[listener remove];

View File

@ -404,6 +404,8 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
QCoreWlanEngine::~QCoreWlanEngine()
{
scanThread->wait(5000);
while (!foundConfigurations.isEmpty())
delete foundConfigurations.takeFirst();
[listener remove];