summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelist.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index 2fc4c41..fdd1163 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -7,14 +7,16 @@
#include "debug.h"
static QDict<Package> *packageListAll;
+static int packageListAllRefCount = 0;
PackageList::PackageList()
: packageIter( packageList )
{
empty=true;
if (!packageListAll) packageListAll = new QDict<Package>();
+ packageListAllRefCount++;
sections << "All";
subSections.insert("All", new QStringList() );
QStringList *ss = subSections["All"];
*ss << "All";
@@ -30,8 +32,9 @@ PackageList::PackageList( PackageManagerSettings* s)
}
PackageList::~PackageList()
{
+ if (--packageListAllRefCount < 1 ) delete packageListAll;
}
/** Inserts a package into the list */
void PackageList::insertPackage( Package* pack )
@@ -50,9 +53,9 @@ void PackageList::insertPackage( Package* pack )
QDict<Package> *packver = p->getOtherVersions();
// p->setName( pack->name()+"["+p->version()+"]" );
if (!packver)
{
- packver = new QDict<Package>;
+ packver = new QDict<Package>();
packver->insert( pack->name(), p );
p->setOtherVersions( packver );
}
pack->setName( pack->name()+"["+pack->version()+"]" );
@@ -181,8 +184,9 @@ void PackageList::readFileEntries( QString filename, QString dest )
}else{
packEntry << line;
};
}
+ delete statusStream;
return;
}
void PackageList::setSettings( PackageManagerSettings *s )