summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-10-30 12:20:31 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2014-10-30 12:20:31 -0700
commitd212b02f931c43a5b0bb40115d842d9c6dcb633c (patch)
tree6cd3e80ae89f6605b9ed4998f9878d42abeae252
parent4e84e2ffdf2257302ec05ed6a8ea7e8a8047899b (diff)
Add a database era lock around -[Package warnings].
-rw-r--r--MobileCydia.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index d58be24..49b74f6 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -3133,6 +3133,10 @@ struct PackageNameOrdering :
} }
- (NSArray *) warnings {
+@synchronized (database_) {
+ if ([database_ era] != era_ || file_.end())
+ return nil;
+
NSMutableArray *warnings([NSMutableArray arrayWithCapacity:4]);
const char *name(iterator_.Name());
@@ -3184,7 +3188,7 @@ struct PackageNameOrdering :
}
return [warnings count] == 0 ? nil : warnings;
-}
+} }
- (NSArray *) applications {
NSString *me([[NSBundle mainBundle] bundleIdentifier]);