From 756f8ae5206e307f3bb3e8f6bc7ffaef17acc562 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 19 Aug 2011 23:28:37 +0000 Subject: [PATCH] Fixed an issue where even if the communication object had Clear() called on it, it could try and call through to an installed callback. llvm-svn: 138146 --- lldb/source/Core/Communication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index a43ed2e929d6..a9ca35c9db85 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -64,6 +64,7 @@ Communication::~Communication() void Communication::Clear() { + SetReadThreadBytesReceivedCallback (NULL, NULL); StopReadThread (NULL); Disconnect (NULL); } @@ -295,7 +296,7 @@ Communication::AppendBytesToCache (const uint8_t * bytes, size_t len, bool broad // If the user registered a callback, then call it and do not broadcast m_callback (m_callback_baton, bytes, len); } - else + else if (bytes != NULL && len > 0) { Mutex::Locker locker(m_bytes_mutex); m_bytes.append ((const char *)bytes, len);