【发布时间】:2014-07-20 15:12:50
【问题描述】:
当我发现 UIWebView 中类型 range 的输入元素添加到文档时泄漏 12 个字节时,我正准备提交我的应用程序以供审核。没有后续泄漏;即使使用滑块也不行。
如果您能就如何继续我的提交提供任何建议,我将不胜感激。我应该担心 12 个字节吗?我是否应该找到解决方法,比如说,根本不使用这个元素?或者,我是否应该向审阅者记录泄漏(在审阅说明标题下)?
可以使用最小的 UIWebView 应用程序复制泄漏:
#import "TjaViewController.h"
@interface TjaViewController ()
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@end
@implementation TjaViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self.webView loadHTMLString:@"<input type='range'>" baseURL:nil];
}
@end
使用 Instruments 分析应用会产生具有以下属性的单个泄漏:
类别:Malloc 12 字节
保留数:1
负责库:JavaScriptCore
负责任的调用者:WTF::fastMalloc(unsigned long)
堆栈恍惚:
32 libsystem_pthread.dylib thread_start
31 libsystem_pthread.dylib _pthread_start
30 libsystem_pthread.dylib _pthread_body
29 WebCore RunWebThread(void*)
28 CoreFoundation CFRunLoopRunInMode
27 CoreFoundation CFRunLoopRunSpecific
26 CoreFoundation __CFRunLoopRun
25 CoreFoundation __CFRunLoopDoSources0
24 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
23 WebCore HandleRunSource
22 WebCore ___ZN7WebCoreL26applicationDidBecomeActiveEP22__CFNotificationCenterPvPK10__CFStringPKvPK14__CFDictionary_block_invoke
21 WebCore WebCore::ThreadTimers::sharedTimerFiredInternal()
20 WebCore WebCore::DocumentLoader::handleSubstituteDataLoadNow(WebCore::Timer<WebCore::DocumentLoader>*)
19 WebCore WebCore::DocumentLoader::responseReceived(WebCore::CachedResource*, WebCore::ResourceResponse const&)
18 WebCore WebCore::DocumentLoader::continueAfterContentPolicy(WebCore::PolicyAction)
17 WebCore WebCore::DocumentLoader::dataReceived(WebCore::CachedResource*, char const*, int)
16 WebCore WebCore::DocumentLoader::commitLoad(char const*, int)
15 WebKit WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char const*, int)
14 WebKit -[WebDataSource(WebInternal) _receivedData:]
13 WebKit -[WebHTMLRepresentation receivedData:withDataSource:]
12 WebCore WebCore::DocumentLoader::commitData(char const*, unsigned long)
11 WebCore WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter*, char const*, unsigned long)
10 WebCore WebCore::HTMLDocumentParser::append(WTF::PassRefPtr<WTF::StringImpl>)
9 WebCore WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode)
8 WebCore WebCore::HTMLDocumentParser::constructTreeFromHTMLToken(WebCore::HTMLToken&)
7 WebCore WebCore::HTMLConstructionSite::executeQueuedTasks()
6 WebCore WebCore::executeTask(WebCore::HTMLConstructionSiteTask&)
5 WebCore WebCore::insert(WebCore::HTMLConstructionSiteTask&, bool)
4 WebCore WebCore::HTMLInputElement::attach(WebCore::Node::AttachContext const&)
3 WebCore WebCore::FeatureObserver::didObserve(WebCore::FeatureObserver::Feature)
2 JavaScriptCore WTF::BitVector::resizeOutOfLine(unsigned long)
1 JavaScriptCore WTF::fastMalloc(unsigned long)
0 JavaScriptCore WTF::MallocHook::recordAllocation(void*, unsigned long)
【问题讨论】:
-
我认为这是 webkit 核心中的一些错误
-
我尝试使用 loadRequest 获取网页并得到相同的泄漏 WebCore::FeatureObserver::observe(WebCore::Document*, WebCore::FeatureObserver::Feature) WebCore::FeatureObserver:: didObserve(WebCore::FeatureObserver::Feature) WTF::BitVector::resizeOutOfLine(unsigned long) WTF::fastMalloc(unsigned long) WTF::MallocHook::recordAllocation(void*, unsigned long)
-
感谢@buaacss 确认泄漏。
标签: memory-leaks uiwebview webkit app-store html-input