I am workign on QT application. I have two scenario under which I am not clear if the memory is being freed or I have to do some thing to free the same
void myFunction(QNetworkReply* reply)
QByteArray datum = reply->readAll();
When I exist the function I assume the memory allocated to QByteArray which is local to function(allocated on Stack) will get freed. or do I have to take some other steps to make sure it gets freed properly. Like calling clear() before leaving the function.
I have the created a queue using the
QList< QPair<QString, QPixmap> > queue;
queue is member variable of class.
I have function which keeps on adding the QPixmap to QList. When the count reach to 20 it starts from 0 element of QLIst.
When I insert the QPixmap on pos say 0 where already there is pixmap, will the previous pix map cleanly freed?
Also when i I call queue.clear to empty the queue Will it free the memory?
I know these are simple queries as memory is being allocated to stack. But I need to make sure everything is cleaned up.
Comments are appreciated.