1
0
Fork 0

ServerHandle: Fix closing failed servers. (#4653)

If the cServerHandle failed to listen, closing it would then crash Cuberite.
This commit is contained in:
Mattes D 2020-04-15 14:13:40 +02:00 committed by GitHub
parent f84bab3bc2
commit 42cc736bfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -63,7 +63,10 @@ cServerHandleImpl::~cServerHandleImpl()
void cServerHandleImpl::Close(void)
{
// Stop the listener sockets:
evconnlistener_disable(m_ConnListener);
if (m_ConnListener != nullptr)
{
evconnlistener_disable(m_ConnListener);
}
if (m_SecondaryConnListener != nullptr)
{
evconnlistener_disable(m_SecondaryConnListener);