From 8041bb7baa97f2b3a51fde3b4b4cbb7be9dae3c3 Mon Sep 17 00:00:00 2001 From: Cosmin Sabou Date: Thu, 12 Mar 2020 20:30:09 +0200 Subject: [PATCH] Backed out changeset 06202ffdb7f5 (bug 1621395) as requested by valentin. CLOSED TREE --- netwerk/protocol/websocket/WebSocketChannel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index 314b5428a699..1db361fdda62 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -448,7 +448,10 @@ class nsWSAdmissionManager { MOZ_COUNT_CTOR(nsWSAdmissionManager); } - ~nsWSAdmissionManager() { MOZ_COUNT_DTOR(nsWSAdmissionManager); } + ~nsWSAdmissionManager() { + MOZ_COUNT_DTOR(nsWSAdmissionManager); + for (uint32_t i = 0; i < mQueue.Length(); i++) delete mQueue[i]; + } class nsOpenConn { public: @@ -482,7 +485,10 @@ class nsWSAdmissionManager { int32_t index = IndexOf(aChannel); MOZ_ASSERT(index >= 0, "connection to remove not in queue"); if (index >= 0) { + nsOpenConn* olddata = mQueue[index]; mQueue.RemoveElementAt(index); + LOG(("Websocket: removing conn %p from the queue", olddata)); + delete olddata; } } @@ -509,7 +515,7 @@ class nsWSAdmissionManager { // // We could hash hostnames instead of using a single big vector here, but the // dataset is expected to be small. - nsTArray> mQueue; + nsTArray mQueue; FailDelayManager mFailures;