From c4a53990f0767b38f0c2454c9e10e4f85ad08093 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 12 Sep 2012 16:56:47 -0400 Subject: Fix bug #291 - fix rehashing bind tags not changing them between servers/clients and ssl/nonssl --- include/base.h | 15 +++++++++++++++ include/socket.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/base.h b/include/base.h index 45c60802c..230ed1db4 100644 --- a/include/base.h +++ b/include/base.h @@ -142,6 +142,21 @@ class CoreExport reference if (value && value->refcount_dec()) delete value; } + + inline reference& operator=(T* other) + { + if (value != other) + { + if (value && value->refcount_dec()) + delete value; + value = other; + if (value) + value->refcount_inc(); + } + + return *this; + } + inline operator bool() const { return value; } inline operator T*() const { return value; } inline T* operator->() const { return value; } diff --git a/include/socket.h b/include/socket.h index 16809c3f8..e868af93e 100644 --- a/include/socket.h +++ b/include/socket.h @@ -146,7 +146,7 @@ namespace irc class CoreExport ListenSocket : public EventHandler { public: - const reference bind_tag; + reference bind_tag; std::string bind_addr; int bind_port; /** Human-readable bind description */ -- cgit v1.2.3