Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Don't leak (thanks LLVM static analysis!)

Although it was the kind of leak that didn't matter much.

Also only do one day of debug comics.

Don't use Tiger deprecated functions.
  • Loading branch information...
commit 9d59ccc866502c816cd48cde5f7892fb9c64fc0a 1 parent 4d820f9
Max Howell authored September 01, 2009

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  PaperBoy.m
7  PaperBoy.m
@@ -85,6 +85,7 @@ -(void)gets:(PublishingHouse*)pub
85 85
 
86 86
             NSLog(@"[PB] OHAI: %@", url);
87 87
             [delegate performSelector:@selector(delivery:) withObject:comic];
  88
+            [comic release];
88 89
         }else{
89 90
             NSLog(@"[PB] HTTP GET %@", url);
90 91
             pub.http = [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:url]
@@ -113,7 +114,7 @@ -(void)execNextScript
113 114
     tm->tm_sec = 0;
114 115
     tm->tm_min = 0;
115 116
     tm->tm_hour = 0;
116  
-    tm->tm_mday -= 1;
  117
+    tm->tm_mday -= 3;
117 118
     last_time = mktime(tm);
118 119
 #else
119 120
 	NSDictionary* dict = [[NSUserDefaults standardUserDefaults] dictionaryForKey:scriptname];
@@ -139,6 +140,7 @@ -(void)execNextScript
139 140
 	// we do this asyncronously with a delay to prevent the UI ceasing
140 141
 	// and to ensure we get the first comic more quickly
141 142
 	[self performSelector:@selector(execNextScript) withObject:nil afterDelay:0.0];
  143
+    [house release];
142 144
 }
143 145
 
144 146
 -(id)initWithDelegate:(id)_delegate
@@ -154,7 +156,8 @@ -(id)initWithDelegate:(id)_delegate
154 156
 	// this way we don't have to escape any paths passed to popen
155 157
 	[fm changeCurrentDirectoryPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"rb"]];
156 158
 	
157  
-	NSArray* files = [fm directoryContentsAtPath:@"."];
  159
+    // TODO error info
  160
+	NSArray* files = [fm contentsOfDirectoryAtPath:@"." error:nil];
158 161
     scripts = [[NSMutableArray arrayWithCapacity:[files count]] retain];
159 162
     for (NSString* fn in files)
160 163
         if (![fn isEqualToString:@"threepanes.rb"] && ![fn isEqualToString:@"template.rb"])

0 notes on commit 9d59ccc

Please sign in to comment.
Something went wrong with that request. Please try again.