forked from OSchip/llvm-project
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
This commit is contained in:
parent
59e27c5f12
commit
756f8ae520
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue