summaryrefslogtreecommitdiff
path: root/MLKDynamicContext.m
diff options
context:
space:
mode:
Diffstat (limited to 'MLKDynamicContext.m')
-rw-r--r--MLKDynamicContext.m15
1 files changed, 13 insertions, 2 deletions
diff --git a/MLKDynamicContext.m b/MLKDynamicContext.m
index ed4357a..7be5748 100644
--- a/MLKDynamicContext.m
+++ b/MLKDynamicContext.m
@@ -17,7 +17,7 @@
? (id) parent_member \
: nil) \
bindings:vars] \
- : (id) (parent ? (id) parent_member : nil));
+ : (id) (parent ? (id) RETAIN (parent_member) : nil));
@implementation MLKDynamicContext
@@ -28,7 +28,7 @@
catchTags:(NSDictionary *)catchTags
currentHandler:(MLKClosure *)handler
{
- _parent = (aContext ? aContext : [MLKDynamicContext currentContext]);
+ ASSIGN (_parent, (aContext ? aContext : [MLKDynamicContext currentContext]));
_environment = MAKE_ENVIRONMENT(vars, _parent, _parent->_environment);
_conditionHandlers = MAKE_ENVIRONMENT(handlers,
_parent,
@@ -62,4 +62,15 @@
forKey:@"MLKDynamicContext"];
return context;
}
+
+-(void) dealloc
+{
+ RELEASE (_conditionHandlers);
+ RELEASE (_restarts);
+ RELEASE (_catchTags);
+ RELEASE (_currentConditionHandler);
+ RELEASE (_environment);
+ RELEASE (_parent);
+ [super dealloc];
+}
@end