summaryrefslogtreecommitdiffstats
path: root/WebCore/websockets/WebSocketChannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/websockets/WebSocketChannel.cpp')
-rw-r--r--WebCore/websockets/WebSocketChannel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index 5c0f4c3..df66c14 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -141,6 +141,7 @@ void WebSocketChannel::didClose(SocketStreamHandle* handle)
void WebSocketChannel::didReceiveData(SocketStreamHandle* handle, const char* data, int len)
{
LOG(Network, "WebSocketChannel %p didReceiveData %d", this, len);
+ RefPtr<WebSocketChannel> protect(this); // The client can close the channel, potentially removing the last reference.
ASSERT(handle == m_handle);
if (!appendToBuffer(data, len)) {
handle->close();