aboutsummaryrefslogtreecommitdiffstats
path: root/Source/NoodleLineNumberView.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/NoodleLineNumberView.m')
-rw-r--r--Source/NoodleLineNumberView.m11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/NoodleLineNumberView.m b/Source/NoodleLineNumberView.m
index 1743782b..f6626eb5 100644
--- a/Source/NoodleLineNumberView.m
+++ b/Source/NoodleLineNumberView.m
@@ -52,7 +52,9 @@
if ((self = [super initWithScrollView:aScrollView orientation:NSVerticalRuler]) != nil)
{
[self setClientView:[aScrollView documentView]];
- }
+ lineIndices = nil;
+ }
+
return self;
}
@@ -65,7 +67,7 @@
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [lineIndices release];
+ if (lineIndices) [lineIndices release];
[font release];
[super dealloc];
@@ -169,8 +171,7 @@
- (void)invalidateLineIndices
{
- [lineIndices release];
- lineIndices = nil;
+ if (lineIndices) [lineIndices release], lineIndices = nil;
}
- (void)textDidChange:(NSNotification *)notification
@@ -246,7 +247,7 @@
// TODO improve performance maybe via threading
if(stringLength>6000000)
return;
- [lineIndices release];
+ if (lineIndices) [lineIndices release];
lineIndices = [[NSMutableArray alloc] init];
index = 0;