]> git.saurik.com Git - cydget.git/commitdiff
Checkpoint.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 28 Feb 2010 22:52:58 +0000 (22:52 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 28 Feb 2010 22:52:58 +0000 (22:52 +0000)
LockScreen.mm
control

index b3509357b86375545ef2be14fd2a85a251e8c99b..ccba730f3f506b7b331c793a58b19cf5bae12276 100644 (file)
@@ -996,6 +996,7 @@ MSHook(bool, _ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6
 @interface CydgetPHPURLProtocol : NSURLProtocol {
     pid_t pid_;
     CFHTTPMessageRef http_;
+    NSFileHandle *handle_;
 }
 
 @end
@@ -1073,18 +1074,17 @@ MSHook(bool, _ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6
     http_ = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, FALSE);
     CFHTTPMessageAppendBytes(http_, (const uint8_t *) "HTTP/1.1 200 OK\r\n", 17);
 
-    NSFileHandle *handle([[NSFileHandle alloc] initWithFileDescriptor:fds[0] closeOnDealloc:YES]);
+    _assert(handle_ == nil);
+    handle_ = [[NSFileHandle alloc] initWithFileDescriptor:fds[0] closeOnDealloc:YES];
 
     [[NSNotificationCenter defaultCenter]
         addObserver:self
         selector:@selector(onRead:)
         name:@"NSFileHandleReadCompletionNotification"
-        object:handle
+        object:handle_
     ];
 
-    [handle readInBackgroundAndNotify];
-
-    [handle release];
+    [handle_ readInBackgroundAndNotify];
 }
 
 - (void) onRead:(NSNotification *)notification {
@@ -1124,6 +1124,10 @@ MSHook(bool, _ZN7WebCore16MIMETypeRegistry29isSupportedJavaScriptMIMETypeERKNS_6
     //[client URLProtocol:self didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorNetworkConnectionLost userInfo:nil]];
 
 - (void) stopLoading {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    [handle_ release];
+    handle_ = nil;
+
     if (pid_ != -1) {
         kill(pid_, SIGTERM);
         int status;
diff --git a/control b/control
index dc4a9f430c22d1925111fca2b89614a022049ef5..c7502acf6a5e3ed550b202cc3acedabb56055ccf 100644 (file)
--- a/control
+++ b/control
@@ -3,7 +3,7 @@ Priority: optional
 Section: Development
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 0.9.3106-1
+Version: 0.9.3107-1
 Description: framework for managing lock screen plugins
 Name: Cydget
 Depends: mobilesubstrate (>= 0.9.2587-1), firmware (>= 2.2), preferenceloader, apr-lib, pcre, cycript (>= 0.9.292-1)