adium 4177:a65e456a1f4c: Can't throw a brick without finding a l...
commits at adium.im
commits at adium.im
Tue Aug 23 02:09:11 UTC 2011
details: http://hg.adium.im/adium/rev/a65e456a1f4c
revision: 4177:a65e456a1f4c
branch: (none)
author: Evan Schoenberg
date: Mon Aug 22 21:09:06 2011 -0500
Can't throw a brick without finding a leak around here...
diffs (112 lines):
diff -r e8813b9e1035 -r a65e456a1f4c Frameworks/Adium Framework/Source/DCJoinChatWindowController.h
--- a/Frameworks/Adium Framework/Source/DCJoinChatWindowController.h Mon Aug 22 20:32:22 2011 -0500
+++ b/Frameworks/Adium Framework/Source/DCJoinChatWindowController.h Mon Aug 22 21:09:06 2011 -0500
@@ -27,8 +27,7 @@
IBOutlet AILocalizationButton *button_joinChat;
IBOutlet AILocalizationButton *button_cancel;
- DCJoinChatViewController *controller; //Current view controller
- NSView *currentView; //
+ DCJoinChatViewController *joinChatViewController; //Current view controller
AIAccountMenu *accountMenu;
@@ -37,7 +36,8 @@
+ (DCJoinChatWindowController *)showJoinChatWindow;
-- (DCJoinChatViewController*)joinChatViewController;
+ at property (nonatomic, retain) DCJoinChatViewController *joinChatViewController;
+
- (void)configureForAccount:(AIAccount *)inAccount;
- (IBAction)joinChat:(id)sender;
diff -r e8813b9e1035 -r a65e456a1f4c Frameworks/Adium Framework/Source/DCJoinChatWindowController.m
--- a/Frameworks/Adium Framework/Source/DCJoinChatWindowController.m Mon Aug 22 20:32:22 2011 -0500
+++ b/Frameworks/Adium Framework/Source/DCJoinChatWindowController.m Mon Aug 22 21:09:06 2011 -0500
@@ -34,6 +34,8 @@
@implementation DCJoinChatWindowController
+ at synthesize joinChatViewController;
+
static DCJoinChatWindowController *sharedJoinChatInstance = nil;
//Create a new join chat window
@@ -54,17 +56,11 @@
}
}
-- (DCJoinChatViewController*)joinChatViewController
-{
- return controller;
-
-}
-
- (IBAction)joinChat:(id)sender
{
// If there is a controller, it handles all of the join-chat work
- if ( controller ) {
- [controller joinChatWithAccount:[[popUp_service selectedItem] representedObject]];
+ if (self.joinChatViewController) {
+ [self.joinChatViewController joinChatWithAccount:[[popUp_service selectedItem] representedObject]];
}
[self closeWindow:nil];
@@ -76,14 +72,13 @@
CGFloat diff;
//Remove the previous view controller's view
- [currentView removeFromSuperview];
- [currentView release]; currentView = nil;
+ [[self.joinChatViewController view] removeFromSuperview];
//Get a view controller for this account if there is one
- controller = [[inAccount.service joinChatView] retain];
- currentView = [controller view];
- [controller setDelegate:self];
- [controller setSharedChatInstance:self];
+ self.joinChatViewController = [inAccount.service joinChatView];
+ NSView *currentView = [self.joinChatViewController view];
+ [self.joinChatViewController setDelegate:self];
+ [self.joinChatViewController setSharedChatInstance:self];
//Resize the window to fit the new view
diff = NSHeight([view_customView frame]) - NSHeight([currentView frame]);
@@ -95,9 +90,9 @@
[[self window] setFrame:windowFrame display:YES animate:YES];
- if (controller && currentView) {
+ if (self.joinChatViewController && currentView) {
[view_customView addSubview:currentView];
- [controller configureForAccount:inAccount];
+ [self.joinChatViewController configureForAccount:inAccount];
}
[popUp_service selectItemWithRepresentedObject:inAccount];
@@ -111,15 +106,19 @@
- (id)initWithWindowNibName:(NSString *)windowNibName
{
[super initWithWindowNibName:windowNibName];
-
- if ( controller )
- [controller release];
-
- controller = nil;
+
+ self.joinChatViewController = nil;
return self;
}
+- (void)dealloc
+{
+ self.joinChatViewController = nil;
+
+ [super dealloc];
+}
+
//Setup the window before it is displayed
- (void)windowDidLoad
{
More information about the commits
mailing list