From: Jay Freeman (saurik) Date: Thu, 17 Mar 2011 07:01:24 +0000 (-0700) Subject: I need to @synchronize access to the StateCache. X-Git-Tag: v1.1.0%rc1~88 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/f18b4a9767afe6603948fcb7750a24e386b5f0eb I need to @synchronize access to the StateCache. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 6555d3c4..4b0fb36e 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -2620,11 +2620,19 @@ struct PackageNameOrdering : } - (BOOL) hasMode { +@synchronized (database_) { + if ([database_ era] != era_ || iterator_.end()) + return nil; + pkgDepCache::StateCache &state([database_ cache][iterator_]); return state.Mode != pkgDepCache::ModeKeep; -} +} } - (NSString *) mode { +@synchronized (database_) { + if ([database_ era] != era_ || iterator_.end()) + return nil; + pkgDepCache::StateCache &state([database_ cache][iterator_]); switch (state.Mode) { @@ -2656,7 +2664,7 @@ struct PackageNameOrdering : } _nodefault } -} +} } - (NSString *) id { return id_;