322374 Crash [@ libobjc.A.dylib.227.0.0] when clearing download list. Call [(ProgressView) setController] on awakeFromNib in ProgressViewController and take care with mProgressController in ProgressView. Patch by Nick Kreeger <nick.kreeger@park.edu>. Camino-only. r=me

This commit is contained in:
mark%moxienet.com 2006-01-04 19:27:51 +00:00
parent 0c1e886ba9
commit 363bdd4168
2 changed files with 15 additions and 2 deletions

View File

@ -58,6 +58,7 @@ NSString* const kDownloadInstanceOpenedNotificationName = @"DownloadInstanceOp
self = [super initWithFrame:frame];
if (self) {
mLastModifier = kNoKey;
mProgressController = nil;
}
return self;
}
@ -107,11 +108,19 @@ NSString* const kDownloadInstanceOpenedNotificationName = @"DownloadInstanceOp
- (BOOL)isSelected
{
// make sure the controller is not nil before checking if it is selected
if (!mProgressController)
return NO;
return [mProgressController isSelected];
}
-(void)setSelected:(BOOL)inSelected
{
// make sure the controller is not nil before setting its selected state
if (!mProgressController)
return;
[mProgressController setSelected:inSelected];
}

View File

@ -160,7 +160,6 @@ static void FileSystemNotificationProc(FNMessage message, OptionBits flags, void
if ((self = [super init]))
{
[NSBundle loadNibNamed:@"ProgressView" owner:self];
[self viewDidLoad];
}
return self;
}
@ -175,6 +174,11 @@ static void FileSystemNotificationProc(FNMessage message, OptionBits flags, void
return self;
}
-(void)awakeFromNib
{
[self viewDidLoad];
}
-(void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
@ -213,7 +217,7 @@ static void FileSystemNotificationProc(FNMessage message, OptionBits flags, void
-(void)viewDidLoad
{
// this isn't necessarily better. Need to profile.
// this isn't necessarily better. Need to profile.
[mProgressBar setUsesThreadedAnimation:NO];
// give the views this controller as their controller
[mCompletedView setController:self];