From b0411dbf581b1cf95270ae557ba620f1ee4a040f Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 26 May 2010 22:25:51 +0000 Subject: [PATCH] Don't leak the NSThread. --- Tweak.mm | 13 ++++++++----- control | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Tweak.mm b/Tweak.mm index d732666..0834b08 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -175,8 +175,9 @@ static void VNCEnabled(); [[$SBStatusBarController sharedStatusBarController] addStatusBarItem:@"Veency"]; } -+ (void) performSetup { ++ (void) performSetup:(NSThread *)thread { NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); + [thread autorelease]; VNCSetup(); VNCEnabled(); [pool release]; @@ -593,11 +594,13 @@ MSHook(kern_return_t, IOMobileFramebufferSwapSetLayer, width_ = size.width; height_ = size.height; - NSThread *thread([[[NSThread alloc] + NSThread *thread([NSThread alloc]); + + [thread initWithTarget:[VNCBridge class] - selector:@selector(performSetup) - object:nil - ] autorelease]); + selector:@selector(performSetup:) + object:thread + ]; [thread start]; } else if (_unlikely(clients_ != 0)) { diff --git a/control b/control index 5f72a8b..b4343b6 100644 --- a/control +++ b/control @@ -5,7 +5,7 @@ Priority: optional Section: Networking Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.3192-1 +Version: 0.9.3193-1 Description: a VNC /server/ for the iPhone Name: Veency Depends: mobilesubstrate (>= 0.9.2966-1), libvncserver, com.saurik.iphone.ske, preferenceloader, jp.ashikase.mousesupport | firmware (<< 3.0) -- 2.45.2