aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFavoriteTextFieldCell.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-02-10 01:32:05 +0000
committerrowanbeentje <rowan@beent.je>2010-02-10 01:32:05 +0000
commit13805614e6ed2131827bfa6c668b50a1b30da1e5 (patch)
tree8142178495af47518a2d693950d8623eec2ff2b5 /Source/SPFavoriteTextFieldCell.m
parentd0fb716108641d3a8c197ef12041bf46b14e7294 (diff)
downloadsequelpro-13805614e6ed2131827bfa6c668b50a1b30da1e5.tar.gz
sequelpro-13805614e6ed2131827bfa6c668b50a1b30da1e5.tar.bz2
sequelpro-13805614e6ed2131827bfa6c668b50a1b30da1e5.zip
Fix a number of memory leaks, and over-releases, as both a result of manual inspection of leaks and Clang static analysis.
Diffstat (limited to 'Source/SPFavoriteTextFieldCell.m')
-rw-r--r--Source/SPFavoriteTextFieldCell.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/SPFavoriteTextFieldCell.m b/Source/SPFavoriteTextFieldCell.m
index ea460af0..355ee459 100644
--- a/Source/SPFavoriteTextFieldCell.m
+++ b/Source/SPFavoriteTextFieldCell.m
@@ -121,8 +121,8 @@
(([self isHighlighted]) && (![[self highlightColorWithFrame:cellFrame inView:controlView] isEqualTo:[NSColor secondarySelectedControlColor]])) ? [self invertFontColors] : [self restoreFontColors];
// Construct and get the sub text attributed string
- NSAttributedString *mainString = [[self attributedStringForFavoriteName] autorelease];
- NSAttributedString *subString = [[self constructSubStringAttributedString] autorelease];
+ NSAttributedString *mainString = [self attributedStringForFavoriteName];
+ NSAttributedString *subString = [self constructSubStringAttributedString];
NSRect subFrame = NSMakeRect(0.0, 0.0, [subString size].width, [subString size].height);
@@ -169,8 +169,8 @@
- (NSSize)cellSize
{
NSSize cellSize = [super cellSize];
- NSAttributedString *mainString = [[self attributedStringForFavoriteName] autorelease];
- NSAttributedString *subString = [[self constructSubStringAttributedString] autorelease];
+ NSAttributedString *mainString = [self attributedStringForFavoriteName];
+ NSAttributedString *subString = [self constructSubStringAttributedString];
// 15 := indention 10 from image to string plus 5 px padding
CGFloat theWidth = MAX([mainString size].width, [subString size].width) + (([self image] != nil) ? [[self image] size].width : 0) + 15;
@@ -225,7 +225,7 @@
// -------------------------------------------------------------------------------
- (NSAttributedString *)constructSubStringAttributedString
{
- return [[NSAttributedString alloc] initWithString:favoriteHost attributes:[self subStringAttributedStringAttributes]];
+ return [[[NSAttributedString alloc] initWithString:favoriteHost attributes:[self subStringAttributedStringAttributes]] autorelease];
}
// -------------------------------------------------------------------------------
@@ -235,7 +235,7 @@
// -------------------------------------------------------------------------------
- (NSAttributedString *)attributedStringForFavoriteName
{
- return [[NSAttributedString alloc] initWithString:favoriteName attributes:[self mainStringAttributedStringAttributes]];
+ return [[[NSAttributedString alloc] initWithString:favoriteName attributes:[self mainStringAttributedStringAttributes]] autorelease];
}
// -------------------------------------------------------------------------------