]> git.saurik.com Git - uikittools.git/commitdiff
Separate unregisters/register, don't interleave.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 1 Jun 2012 05:31:53 +0000 (05:31 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 1 Jun 2012 05:31:53 +0000 (05:31 +0000)
uicache.mm

index 28c518d70697087060f3879c5ae34eba96e9ba7f..91609b7f3b4eea58654391d56754995ba872d296 100644 (file)
@@ -116,14 +116,21 @@ int main(int argc, const char *argv[]) {
 
         [cache writeToFile:path atomically:YES];
 
-        if (workspace != nil)
-            for (NSString *bundle in bundles) {
+        if (workspace != nil) {
+            for (NSString *identifier in bundles) {
                 NSString *path([bundles objectForKey:identifier]);
                 [workspace unregisterApplication:[NSURL fileURLWithPath:path]];
+            }
+
+            for (NSString *identifier in bundles)
                 if ([workspace respondsToSelector:@selector(invalidateIconCache:)])
                     [workspace invalidateIconCache:identifier];
+
+            for (NSString *identifier in bundles) {
+                NSString *path([bundles objectForKey:identifier]);
                 [workspace registerApplication:[NSURL fileURLWithPath:path]];
             }
+        }
 
         if (false) error:
             fprintf(stderr, "%s\n", error == nil ? strerror(errno) : [[error localizedDescription] UTF8String]);