PDA

View Full Version : Mem'ries (like the corners of my mind)



baray98
12th October 2007, 16:27
Guys i am wondering if QVector deleted his items when i call QVector::clear() ?

example


QVector <double> dVector;
for (int i = 0 ; i < 1000000 ; i++)
{
dVector.append((double) i); // this loop will take atleast 1M x 4 of memory
}

//now if i will say
dVector.clear() // what will happen to the item created by the loop.



baray98

jacek
12th October 2007, 16:43
Check what QVector::capacity() returns and to be sure call QVector::squeeze().