summaryrefslogtreecommitdiff
path: root/include/extensible.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-16 21:16:20 -0400
committerAdam <Adam@anope.org>2010-09-16 21:16:20 -0400
commit86c1dab2863f228e92ce7e0bd23ffb17cda0242b (patch)
treed4adf87e720de20eedcd413cc1b7bc9b06247766 /include/extensible.h
parentcd1e9f3181234521a2858f73b47f57a22c0dad40 (diff)
Fixed many bugs and crashes
Diffstat (limited to 'include/extensible.h')
-rw-r--r--include/extensible.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/include/extensible.h b/include/extensible.h
index 884ca8ecb..29ac0504c 100644
--- a/include/extensible.h
+++ b/include/extensible.h
@@ -89,12 +89,10 @@ class CoreExport Extensible : public virtual Base
*
* @return Returns true on success, false if otherwise
*/
- bool Extend(const Anope::string &key, ExtensibleItemBase *p)
+ void Extend(const Anope::string &key, ExtensibleItemBase *p)
{
- bool Ret = this->Extension_Items.insert(std::make_pair(key, p)).second;
- if (!Ret)
- delete p;
- return Ret;
+ this->Shrink(key);
+ this->Extension_Items.insert(std::make_pair(key, p));
}
/** Extend an Extensible class.
@@ -108,13 +106,9 @@ class CoreExport Extensible : public virtual Base
*
* @return Returns true on success, false if otherwise
*/
- bool Extend(const Anope::string &key)
+ void Extend(const Anope::string &key)
{
- /* This will only add an item if it doesnt already exist,
- * the return value is a std::pair of an iterator to the
- * element, and a bool saying if it was actually inserted.
- */
- return this->Extend(key, new ExtensibleItemRegular<char *>(NULL));
+ this->Extend(key, new ExtensibleItemRegular<char *>(NULL));
}
/** Shrink an Extensible class.