Bug 757738 - Websockets: release reference to nsIWebSocketListener after OnClose. r=mcmanus
This commit is contained in:
@@ -535,8 +535,11 @@ public:
|
||||
|
||||
sWebSocketAdmissions->OnStopSession(mChannel, mReason);
|
||||
|
||||
if (mChannel->mListener)
|
||||
if (mChannel->mListener) {
|
||||
mChannel->mListener->OnStop(mChannel->mContext, mReason);
|
||||
mChannel->mListener = nsnull;
|
||||
mChannel->mContext = nsnull;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,11 @@ interface nsIWebSocketListener : nsISupports
|
||||
/**
|
||||
* Called to signify the completion of the message stream.
|
||||
* OnStop is the final notification the listener will receive and it
|
||||
* completes the WebSocket connection. This event can be received in error
|
||||
* cases even if nsIWebSocketChannel::Close() has not been called.
|
||||
* completes the WebSocket connection: after it returns the
|
||||
* nsIWebSocketChannel will release its reference to the listener.
|
||||
*
|
||||
* Note: this event can be received in error cases even if
|
||||
* nsIWebSocketChannel::Close() has not been called.
|
||||
*
|
||||
* @param aContext user defined context
|
||||
* @param aStatusCode reason for stopping (NS_OK if completed successfully)
|
||||
|
||||
Reference in New Issue
Block a user