Changeset 62763 in webkit
- Timestamp:
- Jul 7, 2010 11:23:51 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r62762 r62763 1 2010-07-07 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Nate Chapin. 4 5 [V8] Fix document wrapper memory leak in bindings. 6 https://bugs.webkit.org/show_bug.cgi?id=41771 7 8 * bindings/v8/custom/V8HTMLDocumentCustom.cpp: 9 (WebCore::V8HTMLDocument::WrapInShadowObject): Do not create static persistent handle 10 to shadowConstructor because it keeps the first context alive forever. 11 1 12 2010-07-07 Andreas Kling <andreas.kling@nokia.com> 2 13 -
trunk/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
r60670 r62763 52 52 v8::Local<v8::Object> V8HTMLDocument::WrapInShadowObject(v8::Local<v8::Object> wrapper, Node* impl) 53 53 { 54 DEFINE_STATIC_LOCAL(v8::Persistent<v8::Function >, shadowConstructor, ());55 if (shadow Constructor.IsEmpty()) {56 v8::Local<v8::FunctionTemplate> shadowTemplate = v8::FunctionTemplate::New();54 DEFINE_STATIC_LOCAL(v8::Persistent<v8::FunctionTemplate>, shadowTemplate, ()); 55 if (shadowTemplate.IsEmpty()) { 56 shadowTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New()); 57 57 if (shadowTemplate.IsEmpty()) 58 58 return v8::Local<v8::Object>(); … … 60 60 shadowTemplate->Inherit(V8HTMLDocument::GetTemplate()); 61 61 shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument::internalFieldCount); 62 shadowConstructor = v8::Persistent<v8::Function>::New(shadowTemplate->GetFunction());63 if (shadowConstructor.IsEmpty())64 return v8::Local<v8::Object>();65 62 } 66 63 67 ASSERT(!shadowConstructor.IsEmpty()); 64 v8::Local<v8::Function> shadowConstructor = shadowTemplate->GetFunction(); 65 if (shadowConstructor.IsEmpty()) 66 return v8::Local<v8::Object>(); 67 68 68 v8::Local<v8::Object> shadow = shadowConstructor->NewInstance(); 69 69 if (shadow.IsEmpty())
Note: See TracChangeset
for help on using the changeset viewer.