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. Network Configurations and networkSessions Crash
QtWS25 Last Chance

Network Configurations and networkSessions Crash

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k 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.
  • D Offline
    D Offline
    dmcr
    wrote on last edited by
    #1

    Hi,

    i try to manage more than one QNetworkConfiguration.
    for this, i have two maps :
    @ QMap<QString, QNetworkConfiguration> m_intitule_networkConfig;
    QMap<QString, QNetworkSession*> m_intitule_networkSession;@

    In the slot initiated by updateConfig, i fill both of them :

    @ foreach (QNetworkConfiguration netConfig, m_netManager->allConfigurations())
    {
    QNetworkConfiguration copyConfig(netConfig);
    QNetworkSession* session = new QNetworkSession( copyConfig );
    m_intitule_networkSession.insert(intitule, session );
    m_intitule_networkConfig.insert(intitule, copyConfig);
    }@

    later i want to get the session : @m_currentNetworkSession = m_intitule_networkSession.value( intitule );@

    and then @qDebug() << m_currentNetworkSession->configuration().name();@
    CRASH

    Does someone has some ideas?
    thanks

    dmcr

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      you should check pointers for 0.
      where is test initialized?

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dmcr
        wrote on last edited by
        #3

        sorry, it's not test but m_currentNetworkSession.
        And i have tested and it's not NULL.
        However, it crashed, and then QNetworkSessionPrivate* d is NULL.
        Working on windows and having problems with wifi connections....

        dmcr

        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