我有一个包含一个UIWebView(OS 3.0)一个UIViewController。 如果我与文件数据,只要“后退按钮”加载它被击中,并认为被驳回,我看到EXEC_BAD_ACCESS
误差的WebCore对象释放“SharedBuffer”
- (void)viewDidLoad {
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:fileName ofType:@"html"];
NSData *fileHtmlData = [NSData dataWithContentsOfFile:htmlFile];
[webView loadData:fileHtmlData MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@""]];
}
如果我改变上述通过请求加载,一切都很好。
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
在我的控制器的dealloc,我释放的WebView有以下几点:
[webView setDelegate:nil];
[webView release];
堆栈跟踪低于:
#2 0x359d34ae in WebCore::SharedBuffer::~SharedBuffer
#3 0x358fdab8 in WebCore::DocumentLoader::~DocumentLoader
#4 0x332d3c00 in WebDocumentLoaderMac::~WebDocumentLoaderMac
#5 0x358fec8c in WebCore::FrameLoader::detachFromParent
#6 0x332d8830 in -[WebView(WebPrivate) _close]
#7 0x332d8757 in -[WebView close]
#8 0x332d86db in -[WebView dealloc]
#9 0x35890719 in WebCoreObjCDeallocOnWebThreadImpl
#10 0x358d29ce in HandleWebThreadReleaseSource
有没有别的东西,我需要做的,以防止泄漏/ bad_access错误?