I'm getting a reproducible leak of NSDynamicSystemColor and NSCalibratedRGBColor when running WebKit tests. Steps to reproduce: run-webkit-tests -1 --leaks --no-retry --no-build --no-show --no-sample --debug-rwt-logging --clobber-old-results fast/css/test-setting-canvas-color.html --repeat 10
<rdar://problem/35816332>
It looks like it has to be in this code, but I don't see the problem. if (auto selector = selectCocoaColor()) { if (auto color = wtfObjcMsgSend<NSColor *>([NSColor class], selector)) return convertNSColorToColor(color); }
Maybe we can extract that code into a small command line tool to see if it leaks. Very little dependency on the rest of WebKit in that code.
Created attachment 328267 [details] standalone test No leak seen with this test.
Another thing to test: Comment out that code and see if the leak goes away.
Turns out that it's not every color, but [NSColor controlHighlightColor] leaks on my OS version. Will keep tracking this in radar.
Whoa, I never know about `leaks --atExit`! I normally just added a `sleep(10000)` to my main so I could run leaks in another tab. Some good pro-tips in this thread for leaks debugging.