Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions core/src/deviceloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,26 @@ void DeviceLoader::init(bool async)

void DeviceLoader::asyncInit()
{
#ifdef __ANDROID__

QThread *th = new QThread();
connect(
th, &QThread::started, d,
[=]() {
// initializer thread
d->init();
th->quit(); // this replicates QThread::create behaviour of exiting the event loop after
// executing the lambda function
},
Qt::QueuedConnection);

#else
QThread *th = QThread::create([=] {
// initializer thread
d->init();
});
#endif

oldParent = d->parent();
d->setParent(nullptr);
d->moveToThread(th);
Expand Down
Loading