Just in case if someone is using a NSView with a drawsAsynchronously layer:
self.wantsLayer = true;
self.layer.drawsAsynchronously = true;
And some rectangles are not painted (there are black areas in the NSView from time to time), this might happen because we use setNeedsDisplayInRect - https://developer.apple.com/documentation/appkit/nsview/1483475-setneedsdisplayinrect and then displayIfNeeded - https://developer.apple.com/documentation/appkit/nsview/1483566-displayifneeded immediately. The solution is removing the displayIfNeeded call:
NSView* view = window.contentView;
[view setNeedsDisplayInRect: ...];
//[view displayIfNeeded] <-- Cannot be used because the view might not be painted yet (and a black area is displayed)
Post
Replies
Boosts
Views
Activity
I've found a solution to my problem and I hope it is useful for other users in this thread: If you are compiling with -fsanitize=address, remove the -fsanitize=address flag and try again, it looks like Leaks doesn't like the AddressSanitizer.
Same error when trying to run Leaks for a macOS application (compiled in debug mode) from the GUI and the command line (instruments -t Leaks program_name):
Terminal output:
[ERROR] Run issues detected (trace is still ready to be viewed): Error retrieving leak information.
An error occurred trying to capture Leaks data.Error retrieving leak information.
Instruments Version 11.5 (11E608c) (64535.75)