diff options
-rw-r--r-- | include/extensible.h | 9 | ||||
-rw-r--r-- | src/base.cpp | 4 |
2 files changed, 5 insertions, 8 deletions
diff --git a/include/extensible.h b/include/extensible.h index 0efb1db5f..c24984f26 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -210,22 +210,19 @@ class SimpleExtItem : public ExtensionItem { T* ptr = new T(value); T* old = static_cast<T*>(set_raw(container, ptr)); - Del del; - del(old); + free(container, old); } inline void set(Extensible* container, T* value) { T* old = static_cast<T*>(set_raw(container, value)); - Del del; - del(old); + free(container, old); } inline void unset(Extensible* container) { T* old = static_cast<T*>(unset_raw(container)); - Del del; - del(old); + free(container, old); } void free(Extensible* container, void* item) CXX11_OVERRIDE diff --git a/src/base.cpp b/src/base.cpp index b4ea09bc9..ebd5214db 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -369,13 +369,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<std::string*>(old); + free(container, old); } void StringExtItem::unset(Extensible* container) { void* old = unset_raw(container); - delete static_cast<std::string*>(old); + free(container, old); } void StringExtItem::free(Extensible* container, void* item) |