From fbdd08043e97c2749ce2f03382559bba89abf47a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 23 Apr 2020 16:12:42 +0100 Subject: Unregister pgsql connection fds when they are deleted. --- src/modules/extra/m_pgsql.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 916f164d1..c64017d61 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -225,6 +225,7 @@ class SQLConn : public SQL::Provider, public EventHandler q->OnError(err); delete q; } + Close(); } void OnEventHandlerRead() CXX11_OVERRIDE @@ -506,7 +507,9 @@ restart: void Close() { status = DEAD; - SocketEngine::DelFd(this); + + if (HasFd() && SocketEngine::HasFd(GetFd())) + SocketEngine::DelFd(this); if(sql) { -- cgit v1.2.3