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

Crash on exit when there's pending QNetworkAccessManager request

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P0: Blocker
    • Resolution: Done
    • Affects Version/s: 4.7.4
    • Fix Version/s: None
    • Component/s: Network
    • Environment:
      Symbian Belle wk32
    • Commits:
      ada33b11092f278ae4f1280a6da07ffd151a31b6, 5571dbea919d1f122e7331cb0214e584c89efcb9

      Description

      Steps to Reproduce

      • Install and launch the test application (QNamTest.sis)
      • Press "get" button and exit the application by end key (red button) before "finished" appears in the log

      Actual Result

      • "Application Closed: QNamTest"

      Expected Result

      • Application does not crash

      Other Info

      • If you wait until it shows "finished" in the log, it doesn't crash.
      main.cpp
      #include <QtGui>
      #include <QtNetwork>
      
      class Widget : public QWidget
      {
          Q_OBJECT
      public:
          explicit Widget(QWidget *parent = 0) :
              QWidget(parent)
          {
              QPushButton* button = new QPushButton("get");
              button->setMinimumHeight(100);
              connect(button, SIGNAL(clicked()), SLOT(on_button_clicked()));
              m_log = new QTextBrowser;
              QVBoxLayout* layout = new QVBoxLayout(this);
              layout->addWidget(button);
              layout->addWidget(m_log);
      
      
              m_nam = new QNetworkAccessManager(this);
              connect(m_nam, SIGNAL(finished(QNetworkReply*)), SLOT(on_nam_finished(QNetworkReply*)));
          }
      
      private slots:
          void on_nam_finished(QNetworkReply* reply){
              m_log->append("finished");
              reply->deleteLater();
          }
      
          void on_button_clicked(){
              m_log->append("get");
              m_nam->get(QNetworkRequest(QUrl("http://qt.nokia.com")));
          }
      
      private:
          QNetworkAccessManager* m_nam;
          QTextBrowser* m_log;
      };
      
      int main(int argc, char** argv)
      {
          QApplication app(argc, argv);
          Widget w;
          w.showFullScreen();
          return app.exec();
      }
      
      #include "main.moc"
      
      

        Attachments

        1. main.cpp
          1 kB
        2. QNamTest.sis
          9 kB
        3. qnamtest.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            shkearns Shane Kearns
            Reporter:
            matsumot Tadaaki Matsumoto
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes