how can release the memory after closing tab widget?
I am using a tabwidget and adding tabs dynamically in runtime...
Each tab contains many widgets....
But if i close a tab, its memory is not releasing....how can i handle it?
code in adding tab
Code:
ui->tabWidget_unfiltered->addTab(filesTable,FileName);
aftr closing tab
Code:
ui->tabWidget_unfiltered->removeTab(index);
Here each tab contains a table widget....
And storing each those table in a hash table as
QHash<QString,QTableWidget*> StoredTables;
Hence when i delete that tab, i'm just removing this hash entry as..
Code:
StoredTables.remove(RmovedFilename);
but when i check in Task bar->memory(private eorking set) , the memory is not deallocating after closing the tab....
What should i do?
Re: how can release the memory after closing tab widget?
Ummm, you delete it.
Code:
QWidget *tab
= ui
->tabWidget_unfiltered
->widget
(index
);
ui->tabWidget_unfiltered->removeTab(index);
delete tab;
Re: how can release the memory after closing tab widget?
Ok thank u...how can i release the memory in hash table....?
Re: how can release the memory after closing tab widget?
Empty the hash table (QHash::clear()), delete the hash table.... really depends on what you mean.