Bug 1653642 - Don't release WebSocketChannel in nsWebSocketConnection::Close, r=michal,necko-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D84127
This commit is contained in:
Kershaw Chang 2020-07-20 13:04:08 +00:00
Родитель 2bbf09f2c9
Коммит a7be99f849
2 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -20,7 +20,13 @@ nsWebSocketConnection::nsWebSocketConnection(
mSocketIn(aInputStream),
mSocketOut(aOutputStream),
mWriteOffset(0),
mStartReadingCalled(false) {}
mStartReadingCalled(false) {
LOG(("nsWebSocketConnection ctor %p\n", this));
}
nsWebSocketConnection::~nsWebSocketConnection() {
LOG(("nsWebSocketConnection dtor %p\n", this));
}
NS_IMETHODIMP
nsWebSocketConnection::Init(nsIWebSocketConnectionListener* aListener,
@ -47,6 +53,7 @@ nsWebSocketConnection::Init(nsIWebSocketConnectionListener* aListener,
NS_IMETHODIMP
nsWebSocketConnection::Close() {
LOG(("nsWebSocketConnection::Close %p\n", this));
if (mTransport) {
mTransport->SetSecurityCallbacks(nullptr);
mTransport->SetEventSink(nullptr, nullptr);
@ -66,7 +73,6 @@ nsWebSocketConnection::Close() {
mSocketOut = nullptr;
}
mListener = nullptr;
return NS_OK;
}

Просмотреть файл

@ -37,7 +37,7 @@ class nsWebSocketConnection : public nsIWebSocketConnection,
nsTArray<uint8_t>&& aPayload);
private:
virtual ~nsWebSocketConnection() = default;
virtual ~nsWebSocketConnection();
class OutputData {
public: