Browse Source

fix: msleep in toxuri processEvents loops, to avoid 100% CPU

Fixes #1926 for realsies.
pull/4183/head
tux3 9 years ago
parent
commit
2d0698af95
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
  1. 3
      src/net/toxuri.cpp

3
src/net/toxuri.cpp

@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
#include <QPlainTextEdit>
#include <QPushButton>
#include <QCoreApplication>
#include <QThread>
bool toxURIEventHandler(const QByteArray& eventData)
{
@ -61,6 +62,7 @@ bool handleToxURI(const QString &toxURI) @@ -61,6 +62,7 @@ bool handleToxURI(const QString &toxURI)
core = nexus.getCore();
qApp->processEvents();
QThread::msleep(10);
}
while (!core->isReady())
@ -69,6 +71,7 @@ bool handleToxURI(const QString &toxURI) @@ -69,6 +71,7 @@ bool handleToxURI(const QString &toxURI)
return false;
qApp->processEvents();
QThread::msleep(10);
}
QString toxaddr = toxURI.mid(4);

Loading…
Cancel
Save