Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
4.7.3, 4.8.0
-
None
-
Ubuntu GNU/Linux
Description
Call:
ui->statusBar->showMessage("hello", 4000);
ui->statusBar->showMessage("", 1);
And receive 100% cpu load permanently.
The problem is, that the empty string tricks the clearMessage() (which is called when the message-timeout-timer emits its timeout signal) into thinking there's no timer to delete. The timer then keeps running, in this example with 1ms intervals, causing the cpu load.
A quick fix could be:
626,627d625
< if (d->tempItem.isEmpty())
< return;
631a630,631
> if (d->tempItem.isEmpty())
> return;
(on http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/widgets/qstatusbar.cpp)
So I've just moved the isEmpty check of the string below the check of the d->timer pointer, to ensure a running timer is always deleted properly.
I'd have commited a patch myself, but learning all about gerrit, qt git commits and qt5-modularity-insanity would take me too much time right now.
Note: There are likely more affected versions than 4.8.0 and 4.7.3, but these are the ones I know for sure are affected.