mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1389908 - Make sure the NSColorPanel never has a dangling target, and make sure to set the new target before calling setColor. r=spohl
MozReview-Commit-ID: L71yb593eR2 --HG-- extra : rebase_source : e09fbf3a95ea445180d24c0ee81b153a57441b97
This commit is contained in:
parent
667a3cb5a4
commit
fa53d431d3
@ -54,11 +54,11 @@ HexStrToInt(NSString* str)
|
||||
|
||||
- (void)open:(NSColor*)aInitialColor title:(NSString*)aTitle
|
||||
{
|
||||
[mColorPanel setTitle:aTitle];
|
||||
[mColorPanel setColor:aInitialColor];
|
||||
[mColorPanel setTarget:self];
|
||||
[mColorPanel setAction:@selector(colorChanged:)];
|
||||
[mColorPanel setDelegate:self];
|
||||
[mColorPanel setTitle:aTitle];
|
||||
[mColorPanel setColor:aInitialColor];
|
||||
[mColorPanel makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
@ -80,11 +80,9 @@ HexStrToInt(NSString* str)
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
if ([mColorPanel delegate] == self) {
|
||||
[mColorPanel setTarget:nil];
|
||||
[mColorPanel setAction:nil];
|
||||
[mColorPanel setDelegate:nil];
|
||||
}
|
||||
[mColorPanel setTarget:nil];
|
||||
[mColorPanel setAction:nil];
|
||||
[mColorPanel setDelegate:nil];
|
||||
|
||||
mColorPanel = nil;
|
||||
mColorPicker = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user