diff --git a/dom/workers/SharedWorker.cpp b/dom/workers/SharedWorker.cpp index 568844ac3fd8..f50c2687fe67 100644 --- a/dom/workers/SharedWorker.cpp +++ b/dom/workers/SharedWorker.cpp @@ -136,7 +136,6 @@ SharedWorker::Close() if (mMessagePort) { mMessagePort->Close(); - mMessagePort = nullptr; } } diff --git a/dom/workers/test/sharedWorker_ports.js b/dom/workers/test/sharedWorker_ports.js index a0d29e29a2dc..64672e6abb27 100644 --- a/dom/workers/test/sharedWorker_ports.js +++ b/dom/workers/test/sharedWorker_ports.js @@ -17,6 +17,7 @@ onconnect = function(evt) { test: (evtFromPort2.data.type == "connected"), msg: "The original message received" }); port.postMessage({type: "finish"}); + close(); } } } diff --git a/dom/workers/test/test_sharedWorker_ports.html b/dom/workers/test/test_sharedWorker_ports.html index 8233b3f71f38..32698ab5277e 100644 --- a/dom/workers/test/test_sharedWorker_ports.html +++ b/dom/workers/test/test_sharedWorker_ports.html @@ -28,6 +28,9 @@ sw1.port.onmessage = function(event) { } if (event.data.type == "finish") { + info("Finished!"); + ok(sw1.port, "The port still exists"); + sw1.port.foo = sw1; // Just a test to see if we leak. SimpleTest.finish(); } }