ServerHandle: Fix closing failed servers. (#4653)
If the cServerHandle failed to listen, closing it would then crash Cuberite.
This commit is contained in:
parent
f84bab3bc2
commit
42cc736bfd
@ -63,7 +63,10 @@ cServerHandleImpl::~cServerHandleImpl()
|
|||||||
void cServerHandleImpl::Close(void)
|
void cServerHandleImpl::Close(void)
|
||||||
{
|
{
|
||||||
// Stop the listener sockets:
|
// Stop the listener sockets:
|
||||||
evconnlistener_disable(m_ConnListener);
|
if (m_ConnListener != nullptr)
|
||||||
|
{
|
||||||
|
evconnlistener_disable(m_ConnListener);
|
||||||
|
}
|
||||||
if (m_SecondaryConnListener != nullptr)
|
if (m_SecondaryConnListener != nullptr)
|
||||||
{
|
{
|
||||||
evconnlistener_disable(m_SecondaryConnListener);
|
evconnlistener_disable(m_SecondaryConnListener);
|
||||||
|
Loading…
Reference in New Issue
Block a user