summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-05-30 01:23:34 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-05-30 01:23:34 +0200
commit291370e367f9c51f894ff132860ac2b55727181f (patch)
treedf9aa9e1c11087838cefa67a70e4fc4e90d4e914
parentFixed reversed logic in StringToDimension. (diff)
downloadcuberite-291370e367f9c51f894ff132860ac2b55727181f.tar
cuberite-291370e367f9c51f894ff132860ac2b55727181f.tar.gz
cuberite-291370e367f9c51f894ff132860ac2b55727181f.tar.bz2
cuberite-291370e367f9c51f894ff132860ac2b55727181f.tar.lz
cuberite-291370e367f9c51f894ff132860ac2b55727181f.tar.xz
cuberite-291370e367f9c51f894ff132860ac2b55727181f.tar.zst
cuberite-291370e367f9c51f894ff132860ac2b55727181f.zip
-rw-r--r--src/ClientHandle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 9cba5619d..e3f63b091 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -2181,11 +2181,12 @@ void cClientHandle::SendDestroyEntity(const cEntity & a_Entity)
void cClientHandle::SendDisconnect(const AString & a_Reason)
{
+ // Destruction (Destroy()) is called when the client disconnects, not when a disconnect packet (or anything else) is sent
+ // Otherwise, the cClientHandle instance is can be unexpectedly removed from the associated player - Core/#142
if (!m_HasSentDC)
{
LOGD("Sending a DC: \"%s\"", StripColorCodes(a_Reason).c_str());
m_Protocol->SendDisconnect(a_Reason);
- Destroy();
m_HasSentDC = true;
}
}