Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 6 |
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 | |||
@@ -8,12 +8,14 @@ | |||
8 | #include "debug.h" | 8 | #include "debug.h" |
9 | 9 | ||
10 | static QDict<Package> *packageListAll; | 10 | static QDict<Package> *packageListAll; |
11 | static int packageListAllRefCount = 0; | ||
11 | 12 | ||
12 | PackageList::PackageList() | 13 | PackageList::PackageList() |
13 | : packageIter( packageList ) | 14 | : packageIter( packageList ) |
14 | { | 15 | { |
15 | empty=true; | 16 | empty=true; |
16 | if (!packageListAll) packageListAll = new QDict<Package>(); | 17 | if (!packageListAll) packageListAll = new QDict<Package>(); |
18 | packageListAllRefCount++; | ||
17 | sections << "All"; | 19 | sections << "All"; |
18 | subSections.insert("All", new QStringList() ); | 20 | subSections.insert("All", new QStringList() ); |
19 | QStringList *ss = subSections["All"]; | 21 | QStringList *ss = subSections["All"]; |
@@ -31,6 +33,7 @@ PackageList::PackageList( PackageManagerSettings* s) | |||
31 | 33 | ||
32 | PackageList::~PackageList() | 34 | PackageList::~PackageList() |
33 | { | 35 | { |
36 | if (--packageListAllRefCount < 1 ) delete packageListAll; | ||
34 | } | 37 | } |
35 | 38 | ||
36 | /** Inserts a package into the list */ | 39 | /** Inserts a package into the list */ |
@@ -51,7 +54,7 @@ void PackageList::insertPackage( Package* pack ) | |||
51 | // p->setName( pack->name()+"["+p->version()+"]" ); | 54 | // p->setName( pack->name()+"["+p->version()+"]" ); |
52 | if (!packver) | 55 | if (!packver) |
53 | { | 56 | { |
54 | packver = new QDict<Package>; | 57 | packver = new QDict<Package>(); |
55 | packver->insert( pack->name(), p ); | 58 | packver->insert( pack->name(), p ); |
56 | p->setOtherVersions( packver ); | 59 | p->setOtherVersions( packver ); |
57 | } | 60 | } |
@@ -182,6 +185,7 @@ void PackageList::readFileEntries( QString filename, QString dest ) | |||
182 | packEntry << line; | 185 | packEntry << line; |
183 | }; | 186 | }; |
184 | } | 187 | } |
188 | delete statusStream; | ||
185 | return; | 189 | return; |
186 | } | 190 | } |
187 | 191 | ||