Index: Source/modules/websockets/WebSocket.cpp |
diff --git a/Source/modules/websockets/WebSocket.cpp b/Source/modules/websockets/WebSocket.cpp |
index d9521189d1f1cc283f7ed38d28e4e125ee4bd939..f91ecaad6ac33ddc73c23d5db3b5f6ca6f8cd0ca 100644 |
--- a/Source/modules/websockets/WebSocket.cpp |
+++ b/Source/modules/websockets/WebSocket.cpp |
@@ -489,14 +489,18 @@ void WebSocket::resume() |
void WebSocket::stop() |
{ |
- bool pending = hasPendingActivity(); |
- if (m_channel) |
+ if (!hasPendingActivity()) { |
+ ASSERT(!m_channel); |
+ ASSERT(m_state == CLOSED); |
+ return; |
+ } |
+ if (m_channel) { |
m_channel->disconnect(); |
- m_channel = 0; |
+ m_channel = 0; |
+ } |
m_state = CLOSED; |
ActiveDOMObject::stop(); |
- if (pending) |
- ActiveDOMObject::unsetPendingActivity(this); |
+ ActiveDOMObject::unsetPendingActivity(this); |
} |
void WebSocket::didConnect() |