Changeset 128127 in webkit
- Timestamp:
- Sep 10, 2012 4:23:36 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128126 r128127 1 2012-09-10 Adam Barth <abarth@chromium.org> 2 3 [V8] V8PerIsolateData::m_toStringTemplate leaks memory 4 https://bugs.webkit.org/show_bug.cgi?id=96322 5 6 Reviewed by Kentaro Hara. 7 8 We never call Dispose to balance the call to v8::Persistent::New. This 9 patch uses ScopedPersistent to call Dispose automatically. 10 11 * bindings/v8/V8PerIsolateData.cpp: 12 (WebCore::V8PerIsolateData::toStringTemplate): 13 - I've changed this function to return a new local handle in case 14 anyone is trying to hold on to these handles during shutdown. 15 * bindings/v8/V8PerIsolateData.h: 16 (V8PerIsolateData): 17 1 18 2012-09-10 Adam Barth <abarth@chromium.org> 2 19 -
trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp
r128125 r128127 75 75 } 76 76 77 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() 78 { 79 if (m_toStringTemplate.isEmpty()) 80 m_toStringTemplate.set(v8::FunctionTemplate::New(constructorOfToString)); 81 return v8::Local<v8::FunctionTemplate>::New(m_toStringTemplate.get()); 82 } 83 77 84 void V8PerIsolateData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 78 85 { -
trunk/Source/WebCore/bindings/v8/V8PerIsolateData.h
r128125 r128127 72 72 TemplateMap& templateMap() { return m_templates; } 73 73 74 v8::Persistent<v8::FunctionTemplate>& toStringTemplate() 75 { 76 if (m_toStringTemplate.IsEmpty()) 77 m_toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(constructorOfToString)); 78 return m_toStringTemplate; 79 } 80 74 v8::Handle<v8::FunctionTemplate> toStringTemplate(); 81 75 v8::Persistent<v8::FunctionTemplate>& lazyEventListenerToStringTemplate() 82 76 { … … 144 138 TemplateMap m_rawTemplates; 145 139 TemplateMap m_templates; 146 v8::Persistent<v8::FunctionTemplate> m_toStringTemplate;140 ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate; 147 141 v8::Persistent<v8::FunctionTemplate> m_lazyEventListenerToStringTemplate; 148 142 OwnPtr<StringCache> m_stringCache;
Note: See TracChangeset
for help on using the changeset viewer.