зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
dbff63e270
Коммит
49d056b94f
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
Загрузка…
Ссылка в новой задаче