Network Configurations and networkSessions Crash



  • 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



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



  • 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....


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.