Revision: 18198
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18198&view=rev
Author:   hofman
Date:     2011-10-30 10:04:16 +0000 (Sun, 30 Oct 2011)
Log Message:
-----------
no need to keep task in ivar

Modified Paths:
--------------
    trunk/bibdesk/NSTask_BDSKExtensions.m

Modified: trunk/bibdesk/NSTask_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSTask_BDSKExtensions.m       2011-10-30 06:35:55 UTC (rev 
18197)
+++ trunk/bibdesk/NSTask_BDSKExtensions.m       2011-10-30 10:04:16 UTC (rev 
18198)
@@ -44,11 +44,10 @@
 #define BDSKSpecialPipeServiceRunLoopMode @"BDSKSpecialPipeServiceRunLoopMode"
 
 @interface BDSKTaskRunner : NSObject {
-    NSTask *task;
     // data used to store stdOut from the filter
     NSData *stdoutData;
 }
-- (NSData *)outputDataFromTask:(NSTask *)aTask inputData:(NSData *)input;
+- (NSData *)outputDataFromTask:(NSTask *)task inputData:(NSData *)input;
 - (void)stdoutNowAvailable:(NSNotification *)notification;
 @end
 
@@ -97,7 +96,6 @@
 @implementation BDSKTaskRunner
 
 - (void)dealloc{
-    BDSKDESTROY(task);
     BDSKDESTROY(stdoutData);
     [super dealloc];
 }
@@ -108,7 +106,7 @@
 // - mmcc
 
 // was runWithInputString in TextExtras' TEPipeCommand class.
-- (NSData *)outputDataFromTask:(NSTask *)aTask inputData:(NSData *)input {
+- (NSData *)outputDataFromTask:(NSTask *)task inputData:(NSData *)input {
     NSFileManager *fm = [NSFileManager defaultManager];
     NSString *tmpDir;
     NSPipe *inputPipe;
@@ -116,8 +114,6 @@
     NSFileHandle *inputFileHandle;
     NSFileHandle *outputFileHandle;
     
-    task = [aTask retain];
-    
     // ---------- Execute the script ----------
     // MF:!!! The current working dir isn't too appropriate
     tmpDir = [[NSFileManager defaultManager] 
makeTemporaryDirectoryWithBasename:nil];
@@ -172,8 +168,11 @@
     if (NO == [fm removeItemAtPath:tmpDir error:NULL]) {
         NSLog(@"Filter Pipes: Failed to delete temporary directory. (%@)", 
tmpDir);
     }
-
-    return [task terminationStatus] == 0 ? [[stdoutData retain] autorelease] : 
nil;
+    
+    if ([task terminationStatus] != 0)
+        BDSKDESTROY(stdoutData);
+    
+    return [[stdoutData retain] autorelease];
 }
 
 - (void)stdoutNowAvailable:(NSNotification *)notification {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World™ now supports Android™ Apps 
for the BlackBerry® PlayBook™. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to