Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix: msleep in toxuri processEvents loops, to avoid 100% CPU
Browse files Browse the repository at this point in the history
Fixes #1926 for realsies.
  • Loading branch information
tux3 committed Feb 17, 2017
1 parent bfda028 commit 2d0698a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/net/toxuri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <QPlainTextEdit>
#include <QPushButton>
#include <QCoreApplication>
#include <QThread>

bool toxURIEventHandler(const QByteArray& eventData)
{
Expand Down Expand Up @@ -61,6 +62,7 @@ bool handleToxURI(const QString &toxURI)

core = nexus.getCore();
qApp->processEvents();
QThread::msleep(10);
}

while (!core->isReady())
Expand All @@ -69,6 +71,7 @@ bool handleToxURI(const QString &toxURI)
return false;

qApp->processEvents();
QThread::msleep(10);
}

QString toxaddr = toxURI.mid(4);
Expand Down

0 comments on commit 2d0698a

Please sign in to comment.