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. QList<QString> inpList is crashing the computer when I try to clear it to re use it
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 486 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    Lineaxe
    wrote on last edited by
    #1

    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

    }

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Lineaxe
      wrote on last edited by
      #2

      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 ...:)

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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 :)

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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