C++ Qt memory allocation exception with QList -


How could it be that it throws an exception

 for  (int H = 0; H & lt; listOnecount (); ++ H) {Delete] [List] A [H]; }   

One with the QList list? I repeat float * ARAT until I reach the number of elements in the QList ...

Edit & amp; Solution

In fact, it fails when I am only adding a float to an item in QList, then it is no other float * and You can not delete []

  How could this be a Exceptions thrown   

One posibility: You added an array 2 time to the list. One fix:

 for  (int h = 0; h & lt; list on count (); ++ h) {delete] [list] [h]; ListOne [hr] = nullptr; }   

Perhaps other errors (you are not in the list-add array points). Edit:

In fact, it fails when I'm only adding a float to an item in QList. Again, this is not a float * and you can not delete it [].

I doubt ... a very simple fix:

  float * p = new float [1]; Exemplary [0] = 3.14f;   

Now add pi to the list

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -