Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-24948

Timeout-timer not deleted when calling QStatusBar::clearMessage(), potential for max processor load

    XMLWordPrintable

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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            dermanu Emanuel Eichhammer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes