Fix NS toolbar image release crash (bug#43973)
The toolbar fails to make a proper copy of EmacsImage objects, so releasing the copy incorrectly released instance variables from the original objects. * src/nsimage.m ([EmacsImage copyWithZone:]): New function to enable correct copying of EmacsImage.
This commit is contained in:
parent
dde3269633
commit
d84cf78df8
1 changed files with 12 additions and 0 deletions
|
@ -293,6 +293,18 @@ - (void)dealloc
|
|||
}
|
||||
|
||||
|
||||
- (id)copyWithZone:(NSZone *)zone
|
||||
{
|
||||
EmacsImage *copy = [super copyWithZone:zone];
|
||||
|
||||
copy->stippleMask = [stippleMask copyWithZone:zone];
|
||||
copy->bmRep = [bmRep copyWithZone:zone];
|
||||
copy->transform = [transform copyWithZone:zone];
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
/* Create image from monochrome bitmap. If both FG and BG are 0
|
||||
(black), set the background to white and make it transparent. */
|
||||
- (instancetype)initFromXBM: (unsigned char *)bits width: (int)w height: (int)h
|
||||
|
|
Loading…
Add table
Reference in a new issue