I m 在其进行后从记忆中释放出,在我的NSXMLParser中发现一片 we脏的泄漏。
它是在NSMapTable alloc泄漏的情况下发生的。 在此,我要指出:
0 libSystem.B.dylib calloc
1 libobjc.A.dylib _internal_class_createInstanceFromZone
2 libobjc.A.dylib class_createInstance
3 Foundation NSAllocateObject
4 Foundation +[NSMapTable alloc] <===== this is the leak...
5 Foundation -[NSXMLParser initWithData:]
6 Foundation -[NSXMLParser initWithContentsOfURL:]
7 idispatch -[RootViewController parseXML:] /Developer/iPhone Apps/iDispatch/Classes/RootViewController.m:562 <================== this is my code calling
8 Foundation -[NSThread main]
9 Foundation __NSThread__main__
10 libSystem.B.dylib _pthread_start
11 libSystem.B.dylib thread_start
想法?
赞赏你能够展现的任何光明!
该法典:
[NSThread detachNewThreadSelector:@selector(parseXML:)
toTarget:self
withObject:requestStr];
采用这一方法的:
- (void)parseXML:(NSString*)theURL {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:[NSURL URLWithString:theURL]];
DLog(@"URL: %@",theURL);
[parser setDelegate:self];
[parser parse];
[parser release];
[pool release];
DLog(@"xml parser thread end and released");
}