From 42ac4858f9a8d9550733ca6f647ef375fb33c4b8 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 2 Mar 2013 00:46:39 +0000 Subject: [PATCH] Avoid iOS-6+WinterBoard+Substrate-400x vnode leak. --- Library.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 *); -- 2.45.2