Brendan Shanks (@bshanks) commented about dlls/winemac.drv/cocoa_window.m:
{ WineWindow* window = (WineWindow*)w;
- CGImageRetain(image); + IOSurfaceIncrementUseCount(image);
OnMainThreadAsync(^{ WineContentView *view = [window contentView];
- [view setColorImage:image]; + [view setIOSurface:image]; [view setSurfaceRect:cgrect_mac_from_win(rect)]; [view setNeedsDisplayInRect:NSRectFromCGRect(cgrect_mac_from_win(dirty))];
- CGImageRelease(image); + IOSurfaceDecrementUseCount(image); I think this should be `CFRetain`/`CFRelease` rather than use count, use count seems to be for knowing when an IOSurface can be reused rather than for memory management.
https://github.com/k06a/UIView-FastScreenshot/blob/de71c02b61e59dadde3387491... -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7938#note_104284