From 884171d6eb86a2b8a8dcc536ca52796c7b6af685 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 25 Nov 2010 15:40:38 -0800 Subject: [PATCH] Add @synchronized (database_) around some Package selectors used from JS. --- MobileCydia.mm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index e2a6db31..c2a83db0 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_) { -- 2.45.2