summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-11-25 15:49:24 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-11-25 15:49:24 -0800
commit0944377bb2304a84195f37bed37d59bb2762dad6 (patch)
tree747bc2f4d6e1980cca1b15e59c84d34767f6af97 /MobileCydia.mm
parent884171d6eb86a2b8a8dcc536ca52796c7b6af685 (diff)
Factor out -[Database releasePackages] and use from -[Database dealloc].
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm13
1 files changed, 8 insertions, 5 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index c2a83db..b849f5e 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -2914,12 +2914,17 @@ static NSString *Warning_;
return era_;
}
+- (void) releasePackages {
+ CFArrayApplyFunction(packages_, CFRangeMake(0, CFArrayGetCount(packages_)), reinterpret_cast<CFArrayApplierFunction>(&CFRelease), NULL);
+ CFArrayRemoveAllValues(packages_);
+}
+
- (void) dealloc {
// XXX: actually implement this thing
_assert(false);
- NSRecycleZone(zone_);
- // XXX: malloc_destroy_zone(zone_);
+ [self releasePackages];
apr_pool_destroy(pool_);
+ NSRecycleZone(zone_);
[super dealloc];
}
@@ -3207,9 +3212,7 @@ static NSString *Warning_;
@synchronized (self) {
++era_;
- CFArrayApplyFunction(packages_, CFRangeMake(0, CFArrayGetCount(packages_)), reinterpret_cast<CFArrayApplierFunction>(&CFRelease), NULL);
- CFArrayRemoveAllValues(packages_);
-
+ [self releasePackages];
sources_.clear();
_error->Discard();