]> git.saurik.com Git - winterboard.git/commitdiff
Avoid iOS-6+WinterBoard+Substrate-400x vnode leak.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 2 Mar 2013 00:46:39 +0000 (00:46 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 2 Mar 2013 00:46:39 +0000 (00:46 +0000)
Library.mm

index b40f67e97e9a60683657e43b648f24bd49bbcc80..9202ca3ac6a9445163eb34e3207382cb56df3543 100644 (file)
@@ -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 *);