Hello,
My program uses 2 QList's for it's task.

When it is done it goes idle untill the next task, there I try to clean up:

Qt Code:
  1. while (!imglist.isEmpty())
  2. imglist.removeFirst();
  3. while (!reglist.isEmpty())
  4. reglist.removeFirst();
  5. imglist.clear();
  6. reglist.clear();
To copy to clipboard, switch view to plain text mode 

But it looks likes the memory is not being freed, top reports a whopping 45 mb still in use.
I tried to use the lists with delete and new but I couldn't find the right syntax.
In stead of
Qt Code:
  1. for (int i = 0; i < count; i++)
  2. {
  3. reglist[i].translate(-minx, -miny);
  4. imglist[i] = imglist[i].copy(QRect(minx, miny, width, height));
  5. }
To copy to clipboard, switch view to plain text mode 

Use something like:
Qt Code:
  1. for (int i = 0; i < count; i++)
  2. {
  3. reglist[i]->translate(-minx, -miny);
  4. *imglist[i] = imglist[i]->copy(QRect(minx, miny, width, height));
  5. }
To copy to clipboard, switch view to plain text mode 
I tried various versions with at() and [] but kept getting errors.

I am most curious though to why it is not releasing all that memory in the first place.

Thanks.