QList assignment directly [cause crash] or append [okay]

72 Views Asked by At

What is the difference between these two options?

Option 1:

QList <double> arr_tmp = arr_one;    //arr_one also  QList <double>

Option 2:

QList <double> arr_tmp;
arr_tmp.append(arr_one);

Every 20 ms, I need to call one of these, and each time "arr_tmp" gets about 20,000 items from arr_one.

When I use option 1, my App (Windows 10 + QT 6.5 + MSVC2019) crashes very often, however option 2 works fine.

Very appreciated if any words!!

0

There are 0 best solutions below