Brendan Shanks (@bshanks) commented about dlls/winemac.drv/cocoa_window.m:
surfaceRect = rect; }
- (void) setColorImage:(CGImageRef)image
{
- (void) setIOSurface:(IOSurfaceRef)image
CGImageRelease(colorImage);
colorImage = CGImageRetain(image);
_IOSurface = image;
`WineWindow` should hold a ref to the IOSurface. There's an `IOSurface` ObjC class (toll-free bridged to IOSurfaceRef) which could save a few lines of code, or `CFRetain`/`CFRelease` should work too.