From: Jay Freeman (saurik) Date: Sat, 15 Aug 2009 07:52:43 +0000 (+0000) Subject: Fixed the Emoji bug. X-Git-Tag: v0.9.3900~39 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/96442a01979155c2915e3e957b9e79f697ada3d0?hp=89b5e5bd2a55f0a30362fb63cd79367c44e1c420 Fixed the Emoji bug. --- diff --git a/Library.mm b/Library.mm index 73c9ec3..3e9e6c9 100644 --- a/Library.mm +++ b/Library.mm @@ -1276,24 +1276,22 @@ MSHook(UIImage *, _UIImageWithName, NSString *name) { NSNumber *key([NSNumber numberWithInt:id]); UIImage *image = [UIImages_ objectForKey:key]; if (image != nil) - return reinterpret_cast(image) == [NSNull null] ? nil : image; + return reinterpret_cast(image) == [NSNull null] ? _UISharedImageWithIdentifier(id) : image; if (NSString *path = $pathForFile$inBundle$(name, _UIKitBundle(), true)) { image = [[UIImage alloc] initWithContentsOfFile:path cache:true]; if (image != nil) [image autorelease]; } - if (image == nil) - image = _UISharedImageWithIdentifier(id); [UIImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast(image)) forKey:key]; - return image; + return image == nil ? _UISharedImageWithIdentifier(id) : image; } } MSHook(UIImage *, _UIImageWithNameInDomain, NSString *name, NSString *domain) { - NSString *key = [NSString stringWithFormat:@"D:%zu%@%@", [domain length], domain, name]; - UIImage *image = [PathImages_ objectForKey:key]; + NSString *key([NSString stringWithFormat:@"D:%zu%@%@", [domain length], domain, name]); + UIImage *image([PathImages_ objectForKey:key]); if (image != nil) - return reinterpret_cast(image) == [NSNull null] ? nil : image; + return reinterpret_cast(image) == [NSNull null] ? __UIImageWithNameInDomain(name, domain) : image; if (Debug_) NSLog(@"WB:Debug: UIImageWithNameInDomain(\"%@\", \"%@\")", name, domain); if (NSString *path = $getTheme$([NSArray arrayWithObject:[NSString stringWithFormat:@"Domains/%@/%@", domain, name]])) { @@ -1301,10 +1299,8 @@ MSHook(UIImage *, _UIImageWithNameInDomain, NSString *name, NSString *domain) { if (image != nil) [image autorelease]; } - if (image == nil) - image = __UIImageWithNameInDomain(name, domain); [PathImages_ setObject:(image == nil ? [NSNull null] : reinterpret_cast(image)) forKey:key]; - return image; + return image == nil ? __UIImageWithNameInDomain(name, domain) : image; } MSHook(GSFontRef, GSFontCreateWithName, const char *name, GSFontSymbolicTraits traits, float size) { diff --git a/control b/control index dd79423..18abfa0 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: System Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.2991-1 +Version: 0.9.2992-1 Description: more powerful, open-source SummerBoard Name: WinterBoard Depends: mobilesubstrate (>= 0.9.2958-1), killall