From 567e4846ca1c5bfafe7a188744bda11ce046d3a5 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 16 Sep 2016 08:04:27 -0400 Subject: Clean up how the system app finder/parser is saved in memory a bit. Trying to track down and fix a reported memory leak on some systems. --- src-qt5/core/libLumina/LuminaXDG.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src-qt5/core/libLumina/LuminaXDG.cpp') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index 8ec51530..48185a38 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -79,7 +79,7 @@ void XDGDesktopList::updateList(){ } //If this class is automatically managing the lists, update the watched files/dirs and send out notifications if(watcher!=0){ - qDebug() << "App List Updated:" << lastCheck << appschanged << newfiles << oldkeys; + //qDebug() << "App List Updated:" << lastCheck << appschanged << newfiles << oldkeys; watcher->removePaths(QStringList() << watcher->files() << watcher->directories()); watcher->addPaths(appDirs); if(appschanged){ emit appsUpdated(); } @@ -511,14 +511,15 @@ QStringList LXDG::systemApplicationDirs(){ } XDGDesktopList* LXDG::systemAppsList(){ - static XDGDesktopList sysapps(0,true); // = XDGDesktopList(0,true); //set this to automatically update as needed - if(sysapps.lastCheck.isNull()){ sysapps.updateList(); } //catch the first time the class was used, and prompt for an update right now - return &sysapps; + static XDGDesktopList *sysapps = new XDGDesktopList(0,true); //set this to automatically update as needed + if(sysapps->lastCheck.isNull()){ sysapps->updateList(); } //catch the first time the class was used, and prompt for an update right now + return sysapps; } QList LXDG::systemDesktopFiles(bool showAll, bool showHidden){ //Quick overload for backwards compatibility which uses the static/global class for managing app entries - return systemAppsList()->apps(showAll, showHidden); + XDGDesktopList list(0, false); + return list.apps(showAll, showHidden); } QHash > LXDG::sortDesktopCats(QList apps){ -- cgit