QList<QString> inpList is crashing the computer when I try to clear it to re use it



  • My code is crashing when I try to clear InList below

    void ::somefunction(QList<QString> inpList,char inpChar)
    {
    ... use the inpList

    ....
    inpList.clear(); // crashes on this statement // tried // foreach (String, inpList) inpList.remove // and// inpList. removeall
    inpList.append("A string"); // if i comment out the clear line above the codes works and this line will append to the list

    }



  • Heh that was last nights problem , I woke up again this morning and solved it , it turns out that in a do... while statement I let the previous list go past it's range. never did flag that warning for me ... So , once again solved ...:)


  • Lifetime Qt Champion

    Hi,

    Glad you found out and thanks for sharing the solution.

    Can you please mark the thread as solved using the "Topic Tool" button ? Doing so will let other forum users know that a solution has been found :)


Log in to reply
 

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