我有一個iphone應用程序項目。我使用儀器內存泄漏工具分析了它。根據儀器我有2個泄漏跟蹤如下:爲什麼我在UIApplication中有內存泄漏
start main UIAplicationMain _run CFRunLoopInMode CFRunLoopRunSpecific PurpleEventCallback _UIAplicationHandleEvent sendEvent: handleEvent:withNewEvent:
此跟蹤後,有兩個獨立的痕跡。是什麼導致了這種情況,我該如何解決?
編輯: 泄漏是在第二行根據儀器
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil); //leak
[pool release];
return retVal;
當我第一次創建項目(基於窗口的應用程序模板)時,我使用了創建的main.m。根據文書其是在第二行中的泄漏: NSAutoreleasePool *池= [[NSAutoreleasePool的alloc] INIT]; int retVal = UIApplicationMain(argc,argv,nil,nil); [游泳池釋放]; return retVal; – user339744 2010-05-13 23:06:26