Fix a crash due to m_resource being released while SubresourceLoader::didFinishLoading is executing (issue #439).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@398 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-11-29 16:38:31 +00:00
parent d351bc538c
commit dd144bf903
3 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,17 @@
Index: V8DOMWindowCustom.cpp
===================================================================
--- V8DOMWindowCustom.cpp (revision 100508)
+++ V8DOMWindowCustom.cpp (working copy)
@@ -291,8 +291,11 @@
static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args, bool doTransfer)
{
DOMWindow* window = V8DOMWindow::toNative(args.Holder());
+ Frame* frame = V8Proxy::retrieveFrameForCallingContext();
+ if (!frame)
+ return v8::Undefined();
- DOMWindow* source = V8Proxy::retrieveFrameForCallingContext()->domWindow();
+ DOMWindow* source = frame->domWindow();
ASSERT(source->frame());
// This function has variable arguments and can either be: