зеркало из 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];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
mLastModifier = kNoKey;
|
mLastModifier = kNoKey;
|
||||||
|
mProgressController = nil;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -107,11 +108,19 @@ NSString* const kDownloadInstanceOpenedNotificationName = @"DownloadInstanceOp
|
||||||
|
|
||||||
- (BOOL)isSelected
|
- (BOOL)isSelected
|
||||||
{
|
{
|
||||||
|
// make sure the controller is not nil before checking if it is selected
|
||||||
|
if (!mProgressController)
|
||||||
|
return NO;
|
||||||
|
|
||||||
return [mProgressController isSelected];
|
return [mProgressController isSelected];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)setSelected:(BOOL)inSelected
|
-(void)setSelected:(BOOL)inSelected
|
||||||
{
|
{
|
||||||
|
// make sure the controller is not nil before setting its selected state
|
||||||
|
if (!mProgressController)
|
||||||
|
return;
|
||||||
|
|
||||||
[mProgressController setSelected:inSelected];
|
[mProgressController setSelected:inSelected];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,6 @@ static void FileSystemNotificationProc(FNMessage message, OptionBits flags, void
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
[NSBundle loadNibNamed:@"ProgressView" owner:self];
|
[NSBundle loadNibNamed:@"ProgressView" owner:self];
|
||||||
[self viewDidLoad];
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -175,6 +174,11 @@ static void FileSystemNotificationProc(FNMessage message, OptionBits flags, void
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(void)awakeFromNib
|
||||||
|
{
|
||||||
|
[self viewDidLoad];
|
||||||
|
}
|
||||||
|
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
@ -213,7 +217,7 @@ static void FileSystemNotificationProc(FNMessage message, OptionBits flags, void
|
||||||
|
|
||||||
-(void)viewDidLoad
|
-(void)viewDidLoad
|
||||||
{
|
{
|
||||||
// this isn't necessarily better. Need to profile.
|
// this isn't necessarily better. Need to profile.
|
||||||
[mProgressBar setUsesThreadedAnimation:NO];
|
[mProgressBar setUsesThreadedAnimation:NO];
|
||||||
// give the views this controller as their controller
|
// give the views this controller as their controller
|
||||||
[mCompletedView setController:self];
|
[mCompletedView setController:self];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче