diff options
author | Arnar Mar Sig <antab@antab.is> | 2017-02-06 17:39:38 +0000 |
---|---|---|
committer | Arnar Mar Sig <antab@antab.is> | 2017-02-06 17:39:38 +0000 |
commit | 1822d6f3c7b1c4f75868d2d74f0dbe0d988dd372 (patch) | |
tree | eeaaadcdd194957ae7c360156d6c11aa7c23a62a /src-qt5/core-utils/lumina-config/pages | |
parent | * Remove code duplication from LoadSettings() and fix indentation (tab to space) (diff) | |
download | lumina-1822d6f3c7b1c4f75868d2d74f0dbe0d988dd372.tar.gz lumina-1822d6f3c7b1c4f75868d2d74f0dbe0d988dd372.tar.bz2 lumina-1822d6f3c7b1c4f75868d2d74f0dbe0d988dd372.zip |
Fix memory leak.
Diffstat (limited to 'src-qt5/core-utils/lumina-config/pages')
-rw-r--r-- | src-qt5/core-utils/lumina-config/pages/page_defaultapps.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src-qt5/core-utils/lumina-config/pages/page_defaultapps.cpp b/src-qt5/core-utils/lumina-config/pages/page_defaultapps.cpp index 2e2d6f0d..a21653c9 100644 --- a/src-qt5/core-utils/lumina-config/pages/page_defaultapps.cpp +++ b/src-qt5/core-utils/lumina-config/pages/page_defaultapps.cpp @@ -66,7 +66,7 @@ void page_defaultapps::LoadSettings(int){ //qDebug() << "Mime List:\n" << defMimeList.join("\n"); defMimeList.sort(); //sort by group/mime //Now fill the tree by group/mime - QTreeWidgetItem *group = new QTreeWidgetItem(0); //nothing at the moment + QTreeWidgetItem *group = nullptr; QString ccat; for(int i=0; i<defMimeList.length(); i++){ //Get the info from this entry @@ -76,7 +76,7 @@ void page_defaultapps::LoadSettings(int){ QString def = defMimeList[i].section("::::",2,2); QString comment = defMimeList[i].section("::::",3,50); //Now check if this is a new category - if(ccat!=cat){ + if(group == nullptr || ccat!=cat){ //New group group = new QTreeWidgetItem(0); group->setText(0, cat); //add translations for known/common groups later |