diff options
author | Adam <Adam@anope.org> | 2012-12-27 21:43:19 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-12-28 10:43:30 -0500 |
commit | 379b2ccf92b6124f2026a5ec683cfc98f08e223a (patch) | |
tree | 9cec160f53a579a83950656d5978301823f4312d /include/base.h | |
parent | 3fb4cf56b651eb500b1bbafb14c0d328d81e1f3c (diff) |
The timestamp column in SQL should actually be null sometimes, and fixed some valgrind errors with db_sql_live
Diffstat (limited to 'include/base.h')
-rw-r--r-- | include/base.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/include/base.h b/include/base.h index 6fb974ec4..3bf9eefef 100644 --- a/include/base.h +++ b/include/base.h @@ -73,6 +73,22 @@ class Reference : public ReferenceBase ref->DelReference(this); } + inline Reference<T>& operator=(const Reference<T> &other) + { + if (this != &other) + { + if (*this) + this->ref->DelReference(this); + + this->ref = other.ref; + this->invalid = other.invalid; + + if (*this) + this->ref->AddReference(this); + } + return *this; + } + /* We explicitly call operator bool here in several places to prevent other * operators, such operator T*, from being called instead, which will mess * with any class inheriting from this that overloads this operator. @@ -105,16 +121,6 @@ class Reference : public ReferenceBase return NULL; } - inline void operator=(T *newref) - { - if (operator bool()) - this->ref->DelReference(this); - this->ref = newref; - this->invalid = false; - if (operator bool()) - this->ref->AddReference(this); - } - inline bool operator<(const Reference<T> &other) const { return this < &other; |