retain/release checker: For now don't track the retain count of NSWindow objects (opt for false negatives).

llvm-svn: 65304
This commit is contained in:
Ted Kremenek 2009-02-23 02:51:29 +00:00
parent e6d2b40bcc
commit e73f282213
2 changed files with 7 additions and 2 deletions

View File

@ -1130,8 +1130,12 @@ void RetainSummaryManager::InitializeMethodSummaries() {
addNSObjectMethSummary(GetNullarySelector("autorelease", Ctx), Summ);
// For NSWindow, allocated objects are (initially) self-owned.
// FIXME: For now we opt for false negatives with NSWindow, as these objects
// self-own themselves. However, they only do this once they are displayed.
// Thus, we need to track an NSWindow's display status.
// This is tracked in <rdar://problem/6062711>.
RetainSummary *NSWindowSumm =
getPersistentSummary(RetEffect::MakeReceiverAlias(), SelfOwn);
getPersistentSummary(RetEffect::MakeReceiverAlias(), StopTracking);
addInstMethSummary("NSWindow", NSWindowSumm, "initWithContentRect",
"styleMask", "backing", "defer", NULL);

View File

@ -69,7 +69,8 @@ void f2() {
}
void f2b() {
NSWindow *window = [[NSWindow alloc] // expected-warning{{leak}}
// FIXME: NSWindow doesn't own itself until it is displayed.
NSWindow *window = [[NSWindow alloc] // no-warning
initWithContentRect:NSMakeRect(0,0,100,100)
styleMask:NSTitledWindowMask|NSClosableWindowMask
backing:NSBackingStoreBuffered