<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -133,6 +133,9 @@ extern id Nu__null;
 	
 	while (plist &amp;&amp; (plist != Nu__null)) {
 		id param = [[plist car] car];
+		
+		Macro1Debug(@&quot;restoring bindings: looking up key: %@&quot;,
+			[param stringValue]);
 
 		[calling_context removeObjectForKey:param];		
 		id pvalue = [maskedVariables objectForKey:param];
@@ -309,7 +312,7 @@ extern id Nu__null;
 #ifdef USE_NU_DESTRUCTURE
 		destructure = [match mdestructure:parameters withSequence:cdr];
 #else
-		destructure = [self mdestructure:parameters withSequence:cdr];
+        destructure = [self mdestructure:parameters withSequence:cdr];
 #endif
 
 	}
@@ -394,6 +397,7 @@ extern id Nu__null;
 							fromContext:calling_context];
 
 		[maskedVariables release];
+        maskedVariables = nil;
 
 		// Macro evaluation
 		// If we're just macro-expanding, don't do this step...
@@ -418,14 +422,25 @@ extern id Nu__null;
 		NS_HANDLER
 		#endif
 	{
-		[self restoreBindings:destructure
+	    if (maskedVariables)
+	    {
+		    Macro1Debug(@&quot;Caught exception in macro, restoring bindings&quot;);
+
+		    [self restoreBindings:destructure
 							forMaskedVariables:maskedVariables
 							fromContext:calling_context];
+							
+		    Macro1Debug(@&quot;Caught exception in macro, releasing maskedVariables&quot;);
 
-		[maskedVariables release];
+		    [maskedVariables release];
+	    }
+							
+		Macro1Debug(@&quot;Caught exception in macro, restoring masked arguments&quot;);
 
 		[self restoreArgs:old_args context:calling_context];
 
+		Macro1Debug(@&quot;Caught exception in macro, rethrowing...&quot;);
+
 		#ifdef DARWIN
 		@throw;
 			#else</diff>
      <filename>objc/macro_1.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>27b0961d4f671f40effdc909e5fd99b07a010452</id>
    </parent>
  </parents>
  <author>
    <name>Jeff Buck</name>
    <email>jeffreybuck@mac.com</email>
  </author>
  <url>http://github.com/timburks/nu/commit/3f0a7efa9e227841021d380ea0beb65be91c10b3</url>
  <id>3f0a7efa9e227841021d380ea0beb65be91c10b3</id>
  <committed-date>2009-05-30T22:07:34-07:00</committed-date>
  <authored-date>2009-05-30T22:07:34-07:00</authored-date>
  <message>Fixed double release memory bug in exception handler in macro-1.</message>
  <tree>7666b6f7a4a6a3dcdc1a054b8c9f1a7f6361273d</tree>
  <committer>
    <name>Jeff Buck</name>
    <email>jeffreybuck@mac.com</email>
  </committer>
</commit>
