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

Details

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

    Description

      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;
              }
      

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes