X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fbase.cpp;h=1f9ba3264d46bfb9be29403f8c14ba56257d9026;hb=d38595e7e14e7509e744d33df657d50d00cc201f;hp=afd561ff231d2f528068faa793a90e9f070dc084;hpb=714284aa306f2912eaca0c28d779d227db62a96b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/base.cpp b/src/base.cpp index afd561ff2..1f9ba3264 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -1,10 +1,13 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2013, 2018-2019 Sadie Powell + * Copyright (C) 2012, 2014-2015 Attila Molnar + * Copyright (C) 2012 Robby + * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009 Daniel De Graaf * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2004-2006 Craig Edwards - * Copyright (C) 2006 Oliver Lupton + * Copyright (C) 2006 Oliver Lupton * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -29,26 +32,27 @@ classbase::classbase() { +#ifdef INSPIRCD_ENABLE_RTTI if (ServerInstance) - ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "classbase::+ @%p", (void*)this); + ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "classbase::+%s @%p", typeid(*this).name(), (void*)this); +#endif } CullResult classbase::cull() { - if (ServerInstance) #ifdef INSPIRCD_ENABLE_RTTI - ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "classbase::-%s @%p", - typeid(*this).name(), (void*)this); -#else - ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "classbase::- @%p", (void*)this); + if (ServerInstance) + ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "classbase::-%s @%p", typeid(*this).name(), (void*)this); #endif return CullResult(); } classbase::~classbase() { +#ifdef INSPIRCD_ENABLE_RTTI if (ServerInstance) - ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "classbase::~ @%p", (void*)this); + ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "classbase::~%s @%p", typeid(*this).name(), (void*)this); +#endif } CullResult::CullResult() @@ -284,15 +288,6 @@ void ExtensionItem::unserialize(SerializeFormat format, Extensible* container, c } } -LocalExtItem::LocalExtItem(const std::string& Key, ExtensibleType exttype, Module* mod) - : ExtensionItem(Key, exttype, mod) -{ -} - -LocalExtItem::~LocalExtItem() -{ -} - LocalStringExt::LocalStringExt(const std::string& Key, ExtensibleType exttype, Module* Owner) : SimpleExtItem(Key, exttype, Owner) { @@ -304,7 +299,7 @@ LocalStringExt::~LocalStringExt() std::string LocalStringExt::ToInternal(const Extensible* container, void* item) const { - return item ? *static_cast(item) : std::string(); + return item ? *static_cast(item) : std::string(); } void LocalStringExt::FromInternal(Extensible* container, const std::string& value) @@ -313,7 +308,7 @@ void LocalStringExt::FromInternal(Extensible* container, const std::string& valu } LocalIntExt::LocalIntExt(const std::string& Key, ExtensibleType exttype, Module* mod) - : LocalExtItem(Key, exttype, mod) + : ExtensionItem(Key, exttype, mod) { } @@ -378,13 +373,13 @@ void StringExtItem::FromNetwork(Extensible* container, const std::string& value) void StringExtItem::set(Extensible* container, const std::string& value) { void* old = set_raw(container, new std::string(value)); - delete static_cast(old); + free(container, old); } void StringExtItem::unset(Extensible* container) { void* old = unset_raw(container); - delete static_cast(old); + free(container, old); } void StringExtItem::free(Extensible* container, void* item)