Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QNetworkAccessManager constructor crash

QNetworkAccessManager constructor crash

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 772 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EpicLoyd
    wrote on last edited by
    #1

    ^ crashes at class constuctor. Class

    class Updater: public QObject{
    private:
    QNetworkAccessManager *mgr;
    public:
    Updater(){ mgr = new QNetworkAccessManager(); // crashes here
    };
    ~Updater();
    void CheckFiles();
    }
    
    

    i'm running class like that:

        QFuture<void> ft = QtConcurrent::run([&]{
                                                     Updater *upd = new Updater();
                                                 }
                                             );
    

    Why?And how can i fix that?

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Works here.
      What is the error message you get if it crashes?
      Does it crash if you comment out mgr = new QNetworkAccessManager();?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      E 1 Reply Last reply
      0
      • jsulmJ jsulm

        Works here.
        What is the error message you get if it crashes?
        Does it crash if you comment out mgr = new QNetworkAccessManager();?

        E Offline
        E Offline
        EpicLoyd
        wrote on last edited by
        #3

        @jsulm no, it wouldn't crash o.o

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved