Websockets: release reference to nsIWebSocketListener after OnClose

RESOLVED FIXED in mozilla16

Status

()

Core
Networking: WebSockets
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jduell, Unassigned)

Tracking

unspecified
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 626332 [details] [diff] [review]
Releases ref to listener after calling OnStop.

Necko channels generally have a contract where they release their ref to the listener after the last callback is completed (OnStopRequest: for nsIWebSocketListener, this would be OnStop).  But we're not doing this now in WebSocketChannel, and are instead keeping a ref until the necko channel is destroyed, which puts the onus on the listener to make sure it doesn't have a cyclic reference.  

The current code works (nsIWebSocket releases its ref in Disconnect), and I don't want to actually land this until I've had a chance to look into whether it might break things--it passes mochitests fine on my box, though, FWIW.
Attachment #626332 - Flags: review?(mcmanus)
Comment on attachment 626332 [details] [diff] [review]
Releases ref to listener after calling OnStop.

all uses of mListener should be protected by mStopped, so that's ought to be fine.
Attachment #626332 - Flags: review?(mcmanus) → review+
(Reporter)

Comment 2

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/37776fc33437
https://hg.mozilla.org/mozilla-central/rev/37776fc33437
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.