Last Comment Bug 757738 - Websockets: release reference to nsIWebSocketListener after OnClose
: Websockets: release reference to nsIWebSocketListener after OnClose
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Networking: WebSockets (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Nobody; OK to take it and work on it
:
: Patrick McManus [:mcmanus]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-22 22:51 PDT by Jason Duell [:jduell] (needinfo me)
Modified: 2012-06-30 12:41 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Releases ref to listener after calling OnStop. (2.04 KB, patch)
2012-05-22 22:51 PDT, Jason Duell [:jduell] (needinfo me)
mcmanus: review+
Details | Diff | Splinter Review

Description Jason Duell [:jduell] (needinfo me) 2012-05-22 22:51:14 PDT
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.
Comment 1 Patrick McManus [:mcmanus] 2012-05-23 05:43:09 PDT
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.
Comment 2 Jason Duell [:jduell] (needinfo me) 2012-06-29 23:08:35 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/37776fc33437
Comment 3 Ryan VanderMeulen [:RyanVM] 2012-06-30 12:41:52 PDT
https://hg.mozilla.org/mozilla-central/rev/37776fc33437

Note You need to log in before you can comment on or make changes to this bug.