Am I doing something wrong here but as a test:
dim p,p1 as Picture
dim mask as new Picture(32,32)
p = BitmapForCaching(32,32)
p1 = new Picture(32,32)
p1.ApplyMask(mask)
p.ApplyMask(mask)
Crashes out the app when applying the mask to p.
I cannot see a difference between p1 and p.
Also if the mask comes from a Xojo_Image (immutable) it always crashes
so
dim p,p1 as Picture
dim mask as new Picture(48,48)
dim mask1 as Picture = Control_Help
p = BitmapForCaching(48,48)
p1 = new Picture(48,48)
p1.ApplyMask(mask)
p1.ApplyMask(mask1)
p.ApplyMask(mask)
p.ApplyMask(mask1)
Crashes on p1.ApplyMask(mask1)
Built error shown is
Location: Common/MacOS/DrawableCocoa.cpp:396
Condition: drawableMask->Type() == kDrawableCocoa
Then
Location: Common/MacOS/DrawableCocoa.cpp:399
Condition: IsValidMask(mask)
Cloning the Xojo_Image to a mutable image allows it to be applied
Running on macOS 10.14.6 Xojo 2020r2 on a 1X scaled screen