aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbamse16 <marius@marius.me.uk>2009-07-06 04:48:32 +0000
committerbamse16 <marius@marius.me.uk>2009-07-06 04:48:32 +0000
commit132d2c10c30cccfa3d2a94a475ddf29aa35061ff (patch)
treed94c7c9a24b5dc1e0a8f0aebda6931c6186c29aa
parent9ce12fd67f2b200cdb25dec7f70b724f4c8887e1 (diff)
downloadsequelpro-132d2c10c30cccfa3d2a94a475ddf29aa35061ff.tar.gz
sequelpro-132d2c10c30cccfa3d2a94a475ddf29aa35061ff.tar.bz2
sequelpro-132d2c10c30cccfa3d2a94a475ddf29aa35061ff.zip
Fixed some memory leaks
-rw-r--r--Source/CMTextView.m20
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 32d881bf..3f9a0d57 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -2131,12 +2131,10 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
// get the last line to parse due to SP_SYNTAX_HILITE_BIAS
int end = curPos + SP_SYNTAX_HILITE_BIAS;
- if (end > strlength )
- {
+ if (end > strlength ) {
end = strlength;
} else {
- while(end < strlength)
- {
+ while(end < strlength) {
if([selfstr characterAtIndex:end]=='\n')
break;
end++;
@@ -2146,8 +2144,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
// get the first line to parse due to SP_SYNTAX_HILITE_BIAS
int start = end - (SP_SYNTAX_HILITE_BIAS*2);
if (start > 0)
- while(start>-1)
- {
+ while(start>-1) {
if([selfstr characterAtIndex:start]=='\n')
break;
start--;
@@ -2155,7 +2152,6 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
else
start = 0;
-
textRange = NSMakeRange(start, end-start);
// only to be sure that nothing went wrongly
textRange = NSIntersectionRange(textRange, NSMakeRange(0, [textStore length]));
@@ -2278,9 +2274,17 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
NSMutableAttributedStringAddAttributeValueRange(textStore, kBTQuote, kBTQuoteValue, tokenRange);
}
-
+
+ [commentColor release];
+ [quoteColor release];
+ [keywordColor release];
+ [backtickColor release];
+ [numericColor release];
+ [variableColor release];
+ [textColor release];
}
+
#pragma mark -
#pragma mark context menu