From bbd82fe81c50f8e8ca3fb2b60d08c439c85bf440 Mon Sep 17 00:00:00 2001 From: pebble8888 Date: Fri, 28 Jun 2013 13:42:53 +0900 Subject: [PATCH 1/2] Fix crash typing '100' in Xcode5 --- XVim/XVimEvaluatorContext.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XVim/XVimEvaluatorContext.m b/XVim/XVimEvaluatorContext.m index 2e96a7fe..e135c1ef 100644 --- a/XVim/XVimEvaluatorContext.m +++ b/XVim/XVimEvaluatorContext.m @@ -97,7 +97,7 @@ - (XVimEvaluatorContext*)setArgumentString:(NSString*)argument - (XVimEvaluatorContext*)appendArgument:(NSString*)argument { - _argumentString = [_argumentString stringByAppendingString:argument]; + _argumentString = [[_argumentString copy] stringByAppendingString:argument]; return self; } @@ -112,4 +112,4 @@ - (XVimEvaluatorContext*)copy return instance; } -@end \ No newline at end of file +@end From 8049839a9a8f2aadc3d278724b40d096f5522285 Mon Sep 17 00:00:00 2001 From: pebble8888 Date: Fri, 28 Jun 2013 16:06:15 +0900 Subject: [PATCH 2/2] Fix crash typing '100' in Xcode5 2 --- XVim/XVimEvaluatorContext.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/XVim/XVimEvaluatorContext.m b/XVim/XVimEvaluatorContext.m index e135c1ef..0e27c4bc 100644 --- a/XVim/XVimEvaluatorContext.m +++ b/XVim/XVimEvaluatorContext.m @@ -71,12 +71,14 @@ - (NSUInteger)numericArg - (void)pushEmptyNumericArgHead { _numericArgTail = [self numericArg]; + [_numericArgHead release]; _numericArgHead = nil; } - (void)setNumericArgHead:(NSUInteger)numericArg { - _numericArgHead = [NSNumber numberWithUnsignedInteger:numericArg]; + [_numericArgHead release]; + _numericArgHead = [[NSNumber numberWithUnsignedInteger:numericArg] retain]; } - (NSNumber*)numericArgHead @@ -91,13 +93,16 @@ - (NSString*)argumentString - (XVimEvaluatorContext*)setArgumentString:(NSString*)argument { + [_argumentString release]; _argumentString = [argument copy]; return self; } - (XVimEvaluatorContext*)appendArgument:(NSString*)argument { - _argumentString = [[_argumentString copy] stringByAppendingString:argument]; + NSString* str = [_argumentString stringByAppendingString:argument]; + [_argumentString release]; + _argumentString = [str retain]; return self; }