Index: Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp |
=================================================================== |
--- Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp (revision 95974) |
+++ Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp (working copy) |
@@ -50,10 +50,12 @@ |
MessagePortArray* ports = event->ports(); |
if (!ports || ports->isEmpty()) |
return v8::Null(); |
+ |
+ MessagePortArray portsCopy(*ports); |
- v8::Local<v8::Array> portArray = v8::Array::New(ports->size()); |
- for (size_t i = 0; i < ports->size(); ++i) |
- portArray->Set(v8::Integer::New(i), toV8((*ports)[i].get())); |
+ v8::Local<v8::Array> portArray = v8::Array::New(portsCopy.size()); |
+ for (size_t i = 0; i < portsCopy.size(); ++i) |
+ portArray->Set(v8::Integer::New(i), toV8(portsCopy[i].get())); |
return portArray; |
} |