<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -157,13 +157,6 @@ static BOOL NSStringsEqual(NSString *s1, NSString *s2) {
     
 }
 
-#if 0
-- (void)endAlertSheet:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
-{
-    // we don't care about any of the args
-}
-#endif
-
 - (NSString *)getMyIp {
     char **addrs;
     struct hostent *he = gethostbyname(&quot;myip.opendns.com&quot;);
@@ -323,14 +316,22 @@ static BOOL NSStringsEqual(NSString *s1, NSString *s2) {
 }
 
 - (void)ipChangeThread {
-    NSAutoreleasePool* myAutoreleasePool = [[NSAutoreleasePool alloc] init];
+    NSAutoreleasePool* myAutoreleasePool = nil;
+    int cyclesBeforeDrain;
     while (!exitIpChangeThread_) {
+        if (!myAutoreleasePool) {
+            myAutoreleasePool = [[NSAutoreleasePool alloc] init];
+            cyclesBeforeDrain = 10;
+        }
         [self performSelectorOnMainThread:@selector(ipAddressCheckAndPeriodicIpUpdate:) withObject:nil waitUntilDone:YES];
         NSDate *inOneMinute = [[NSDate date] addTimeInterval:TIME_INTERVAL_ONE_MINUTE];
         [NSThread sleepUntilDate:inOneMinute];
-        [myAutoreleasePool drain];
+        if (0 == --cyclesBeforeDrain) {
+            [myAutoreleasePool drain];
+            myAutoreleasePool = nil;
+        }
     }
-    [myAutoreleasePool release];
+    [myAutoreleasePool drain];
 }
 
 // equivalent of  echo &quot;${s}&quot; | openssl enc -bf -d -pass pass:&quot;NojkPqnbK8vwmaJWVnwUq&quot; -salt -a</diff>
      <filename>mac/AppController.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ab005694e8912026059961f25d7378c12ddb7dde</id>
    </parent>
  </parents>
  <author>
    <name>Krzysztof Kowalczyk</name>
    <email>kkowalczyk@gmail.com</email>
  </author>
  <url>http://github.com/opendns/dynamicipupdate/commit/c4a1e833f899541495a7ae56e36feaf849b35a69</url>
  <id>c4a1e833f899541495a7ae56e36feaf849b35a69</id>
  <committed-date>2009-07-08T16:30:29-07:00</committed-date>
  <authored-date>2009-07-08T16:30:29-07:00</authored-date>
  <message>fix leaking of NSDate - [NSAutoReleasePool drain] doesn't do what I thought it does</message>
  <tree>2a9f5df96307735aa4e7bf7bb919e207f5d63ce4</tree>
  <committer>
    <name>Krzysztof Kowalczyk</name>
    <email>kkowalczyk@gmail.com</email>
  </committer>
</commit>
