diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2014-05-17 15:08:32 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2014-05-17 15:08:32 -0700 |
commit | dd4e70dc2d92c8e83eed540771ae0c7d57d2b4ef (patch) | |
tree | d32386cde55879c27f614c4dc899fcf8b2ea68dd /MobileCydia.mm | |
parent | e5491e287265a5f1c6ace2adf693fdc5367b3e7a (diff) |
Sorting packages also requires the database lock.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 586a54e..8f440f5 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -6606,16 +6606,14 @@ typedef Function<void, NSMutableArray *> PackageSorter; } } - (NSMutableArray *) _reloadPackages { - NSMutableArray *filtered; - PackageSorter sorter; - @synchronized (database_) { era_ = [database_ era]; - NSArray *packages([database_ packages]); - filtered = [NSMutableArray arrayWithCapacity:[packages count]]; + NSArray *packages([database_ packages]); + NSMutableArray *filtered([NSMutableArray arrayWithCapacity:[packages count]]); PackageFilter filter; + PackageSorter sorter; @synchronized (self) { filter = filter_; @@ -6627,12 +6625,11 @@ typedef Function<void, NSMutableArray *> PackageSorter; if ([package valid] && filter(package)) [filtered addObject:package]; _end -} if (sorter) sorter(filtered); return filtered; -} +} } - (id) initWithDatabase:(Database *)database title:(NSString *)title filter:(PackageFilter)filter { if ((self = [super initWithDatabase:database title:title]) != nil) { |