Skip to content

Commit

Permalink
[libqofono] Synchronously requested QOfonoManager must be up to date.…
Browse files Browse the repository at this point in the history
… JB#51589

If QOfonoManager::instance() is invoked first and the modem query
hasn't completed yet, QOfonoManager::instance(true) would return an
instance without the modem list. That's not right.

Explicit intention to block must guarantee that the returned
instance if fully up to date.
  • Loading branch information
monich committed Nov 10, 2020
1 parent 6aaa049 commit 54bdef3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/qofonomanager.cpp
Expand Up @@ -276,7 +276,9 @@ QSharedPointer<QOfonoManager> QOfonoManager::instance(bool mayBlock)
if (mgr.isNull()) {
mgr = QSharedPointer<QOfonoManager>(new QOfonoManager(mayBlock), &QObject::deleteLater);
sharedInstance = mgr;
} else {
} else if (mayBlock) {
// Make sure that modems are available
mgr->getModems();
}
return mgr;
}

0 comments on commit 54bdef3

Please sign in to comment.