From 37e55bd3ab15f915e0b7860ded1b6f6e5aefd249 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 1 Jun 2012 05:31:53 +0000 Subject: Separate unregisters/register, don't interleave. --- uicache.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/uicache.mm b/uicache.mm index 28c518d..91609b7 100644 --- a/uicache.mm +++ b/uicache.mm @@ -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]); -- cgit v1.2.3