CoreWLan: terminate scan thread in QCoreWlanEngine destructor

The scan thread can take an indeterminate amount of time, often longer
than the 5 seconds we had previously waited. Since this destructor is
only called when the application quits, it's ok that some resources may
be lost.

Task-number: QTBUG-36000
Change-Id: Ib184156b5a23c39ea4f7937a26ecb099554bd4de
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
bb10
Dyami Caliri 2014-08-22 08:35:29 -07:00
parent 4dc751360a
commit 1d7408cc8b
2 changed files with 4 additions and 2 deletions

View File

@ -419,7 +419,8 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
QCoreWlanEngine::~QCoreWlanEngine()
{
scanThread->wait(5000);
scanThread->terminate();
scanThread->wait();
while (!foundConfigurations.isEmpty())
delete foundConfigurations.takeFirst();

View File

@ -404,7 +404,8 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
QCoreWlanEngine::~QCoreWlanEngine()
{
scanThread->wait(5000);
scanThread->terminate();
scanThread->wait();
while (!foundConfigurations.isEmpty())
delete foundConfigurations.takeFirst();