diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2010-11-25 15:40:38 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-11-25 15:40:38 -0800 |
commit | 884171d6eb86a2b8a8dcc536ca52796c7b6af685 (patch) | |
tree | 454d784d45e1576488021841945b049ff18588d6 /MobileCydia.mm | |
parent | b9956841366cca108cde8e571dd94d02c7fc16f0 (diff) |
Add @synchronized (database_) around some Package selectors used from JS.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index e2a6db3..c2a83db 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -2245,16 +2245,22 @@ struct PackageNameOrdering : } - (Address *) maintainer { - if (file_.end()) +@synchronized (database_) { + if ([database_ era] != era_ || file_.end()) return nil; + pkgRecords::Parser *parser = &[database_ records]->Lookup(file_); const std::string &maintainer(parser->Maintainer()); return maintainer.empty() ? nil : [Address addressWithString:[NSString stringWithUTF8String:maintainer.c_str()]]; -} +} } - (size_t) size { - return version_.end() ? 0 : version_->InstalledSize; -} +@synchronized (database_) { + if ([database_ era] != era_ || version_.end()) + return 0; + + return version_->InstalledSize; +} } - (NSString *) longDescription { @synchronized (database_) { |