X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fbase.cpp;h=1f9ba3264d46bfb9be29403f8c14ba56257d9026;hb=d38595e7e14e7509e744d33df657d50d00cc201f;hp=b4ea09bc9b330f6393c0c821ad03e66560cc2788;hpb=703ba72071b970caaa7554b1e58a13def57694dc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/base.cpp b/src/base.cpp index b4ea09bc9..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() @@ -295,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) @@ -369,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)