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.
}
+- (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