CRealListener: Inform CListener about being destroyed

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1865 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-04-01 08:28:45 +00:00
parent 9d82e9b920
commit dd905ba3eb
2 changed files with 11 additions and 3 deletions
+4
View File
@@ -1992,3 +1992,7 @@ void CZNC::LeakConnectUser(CConnectUserTimer *pTimer) {
if (m_pConnectUserTimer == pTimer)
m_pConnectUserTimer = NULL;
}
CRealListener::~CRealListener() {
m_pParent->SetRealListener(NULL);
}
+7 -3
View File
@@ -175,8 +175,8 @@ protected:
class CRealListener : public CZNCSock {
public:
CRealListener() : CZNCSock() {}
virtual ~CRealListener() {}
CRealListener(CListener *pParent) : CZNCSock(), m_pParent(pParent) {}
virtual ~CRealListener();
virtual bool ConnectionFrom(const CString& sHost, unsigned short uPort) {
bool bHostAllowed = CZNC::Get().IsHostAllowed(sHost);
@@ -203,6 +203,9 @@ public:
Close();
}
}
private:
CListener* m_pParent;
};
class CListener {
@@ -225,6 +228,7 @@ public:
void SetAddrType(EAddrType eAddr) { m_eAddr = eAddr; }
void SetPort(unsigned short u) { m_uPort = u; }
void SetBindHost(const CString& s) { m_sBindHost = s; }
void SetRealListener(CRealListener* p) { m_pListener = p; }
// !Setters
// Getters
@@ -240,7 +244,7 @@ public:
return false;
}
m_pListener = new CRealListener;
m_pListener = new CRealListener(this);
bool bSSL = false;
#ifdef HAVE_LIBSSL