From: Jay Freeman (saurik) Date: Sat, 2 Mar 2013 00:46:39 +0000 (+0000) Subject: Avoid iOS-6+WinterBoard+Substrate-400x vnode leak. X-Git-Tag: v0.9.3911~1 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/42ac4858f9a8d9550733ca6f647ef375fb33c4b8 Avoid iOS-6+WinterBoard+Substrate-400x vnode leak. --- diff --git a/Library.mm b/Library.mm index b40f67e..9202ca3 100644 --- a/Library.mm +++ b/Library.mm @@ -2359,9 +2359,13 @@ MSInitialize { if (imageio == NULL) imageio = MSGetImageByName("/System/Library/PrivateFrameworks/ImageIO.framework/ImageIO"); if (MSImageRef image = imageio) { - void *(*CGImageReadCreateWithFile)(NSString *, int); - msset(CGImageReadCreateWithFile, image, "_CGImageReadCreateWithFile"); - MSHookFunction(CGImageReadCreateWithFile, MSHake(CGImageReadCreateWithFile)); + void *(*CGImageReadCreateWithFile)(NSString *, int) = NULL; + if (kCFCoreFoundationVersionNumber > 700) // XXX: iOS 6.x + CGImageReadCreateWithFile = NULL; + else { + msset(CGImageReadCreateWithFile, image, "_CGImageReadCreateWithFile"); + MSHookFunction(CGImageReadCreateWithFile, MSHake(CGImageReadCreateWithFile)); + } if (CGImageReadCreateWithFile == NULL) { void *(*CGImageSourceCreateWithFile)(NSString *, NSDictionary *);