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

QFuture::takeResult asserts

XMLWordPrintable

    • All
    • 51d04d091 (dev), 1101944d2 (6.10), 1adb43b6e (dev), 8eba40021 (6.10), f632adcd4 (6.9), 4a86c6198 (6.9), ef32a096a (tqtc/lts-6.8), 04099a57a (tqtc/lts-6.8)

       

      Sample code:

      QPromise<int> promise{QFutureInterface<int>{QFutureInterfaceBase::State::Pending}};
      
      promise.future().takeResult(); // should not assert, before wait !
      promise.future().result();     // works correctly, waits forever for result 

      The problem is in

      https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=blob;f=src/corelib/thread/qfutureinterface.h;hb=HEAD#l448

      and in

      https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=blob;f=src/corelib/thread/qfutureinterface.h;hb=HEAD#l469

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

            taipan BogDan Vatra
            taipan BogDan Vatra
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: