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

QHash<QNetworkReply*, QString> crash when I use STL-style iterator to call reply->abort()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.13.2
    • None
    • macOS

      QHash<QNetworkReply*, QString> crash when I use STL-style iterator to call reply->abort()
      but if I call the reply->abort() by for loop, it's OK.

      code by using iterator:

        auto i = m_replyMap.begin();
        while (i != m_replyMap.end()) {
          i.key()->abort();
          i++;
        }
      

      code by using for loop:

        for (auto key : m_replyMap.keys()) {
          key->abort();
        }
      

      the debugger show that when access the nextNode, it just crash.

              inline iterator operator++(int) {
                  iterator r = *this;
                  i = QHashData::nextNode(i); // stop in here
                  return r;
              }
      

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

            thiago Thiago Macieira
            oliver.yeung oliver yeung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes