diff options
| author | Adam <Adam@anope.org> | 2013-02-14 20:57:40 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-02-14 20:57:40 -0500 |
| commit | 391f2822c8f6da7d6ffa8114817a8baf2aa265d5 (patch) | |
| tree | b8c9c566481fe13083d12f0d750ba30ca3e87456 /include | |
| parent | f0875c5d85e0a6c1d878aed01673c0d909a8d488 (diff) | |
This Serialize::Destroy method isn't actually needed anymore. Fixes weirdness from a few Serializable items we had on the stack. Added a comment about why operator< in Reference fails.
Diffstat (limited to 'include')
| -rw-r--r-- | include/base.h | 15 | ||||
| -rw-r--r-- | include/serialize.h | 5 |
2 files changed, 11 insertions, 9 deletions
diff --git a/include/base.h b/include/base.h index fdd8f3f5c..727918af3 100644 --- a/include/base.h +++ b/include/base.h @@ -121,10 +121,17 @@ class Reference : public ReferenceBase return NULL; } - inline bool operator<(const Reference<T> &other) const - { - return this < &other; - } + /** Note that we can't have an operator< that returns this->ref < other.ref + * because this function is used to sort objects in containers (such as set + * or map), and if the references themselves can change if the object they + * refer to is invalidated or changed, then this screws with the order that + * the objects would be in the container without properly adjusting the + * container, resulting in weird stuff. + * + * As such, we don't allow storing references in containers that require + * operator<, because they would not be able to compare what the references + * actually referred to. + */ inline bool operator==(const Reference<T> &other) { diff --git a/include/serialize.h b/include/serialize.h index b136412e4..b74257f73 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -83,11 +83,6 @@ class CoreExport Serializable : public virtual Base /* Unique ID (per type, not globally) for this object */ unsigned int id; - /* Destroys this object. This is effectively the same thing as - * delete, however it properly cleans up after this object. - */ - void Destroy(); - /** Marks the object as potentially being updated "soon". */ void QueueUpdate(); |
