这段代码在哪里泄漏?

时间:2010-02-20 04:08:41

标签: iphone cocoa-touch memory-leaks

仪器告诉我这个代码泄漏了。哪里?我必须释放conn吗?

- (void)loadFeatureXML:(id<BPLFeatureLoaderDelegate>)delegate {

    _delegate = delegate;

    NSURLConnection *conn;
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.myxmlfeed"]];
    if ([NSURLConnection canHandleRequest:request]) {   
        conn = [NSURLConnection connectionWithRequest:request delegate:self];
        if (conn) {
        self.featureXMLData = [NSMutableData data];
        }
    } 
}

1 个答案:

答案 0 :(得分:1)

我最好的猜测是你泄漏了代表;为什么不:

self._delegate = delegate;

就像下面的self.featureXMLData一样?