summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/extensible.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/extensible.h b/include/extensible.h
index d3d22a97e..10e96d875 100644
--- a/include/extensible.h
+++ b/include/extensible.h
@@ -21,6 +21,7 @@ class CoreExport ExtensionItem
const std::string key;
Module* const owner;
ExtensionItem(const std::string& key, Module* owner);
+ virtual ~ExtensionItem();
/** Serialize this item into a string
*
* @param format The format to serialize to
@@ -83,7 +84,7 @@ class CoreExport Extensible : public classbase
static bool Register(ExtensionItem* item);
static std::vector<ExtensionItem*> BeginUnregister(Module* module);
void doUnhookExtensions(const std::vector<ExtensionItem*>& toRemove);
-
+
// Friend access for the protected getter/setter
friend class ExtensionItem;
};
@@ -93,6 +94,7 @@ class CoreExport LocalExtItem : public ExtensionItem
{
public:
LocalExtItem(const std::string& key, Module* owner);
+ virtual ~LocalExtItem();
virtual std::string serialize(SerializeFormat format, const Extensible* container, void* item);
virtual void unserialize(SerializeFormat format, Extensible* container, const std::string& value);
virtual void free(void* item) = 0;
@@ -106,6 +108,10 @@ class CoreExport SimpleExtItem : public LocalExtItem
{
}
+ virtual ~SimpleExtItem()
+ {
+ }
+
inline T* get(const Extensible* container)
{
return static_cast<T*>(get_raw(container));
@@ -151,6 +157,7 @@ class CoreExport LocalStringExt : public SimpleExtItem<std::string>
{
public:
LocalStringExt(const std::string& key, Module* owner);
+ virtual ~LocalStringExt();
std::string serialize(SerializeFormat format, const Extensible* container, void* item);
};
@@ -158,6 +165,7 @@ class CoreExport LocalIntExt : public LocalExtItem
{
public:
LocalIntExt(const std::string& key, Module* owner);
+ virtual ~LocalIntExt();
std::string serialize(SerializeFormat format, const Extensible* container, void* item);
intptr_t get(const Extensible* container);
intptr_t set(Extensible* container, intptr_t value);
@@ -168,6 +176,7 @@ class CoreExport StringExtItem : public ExtensionItem
{
public:
StringExtItem(const std::string& key, Module* owner);
+ virtual ~StringExtItem();
std::string* get(const Extensible* container);
std::string serialize(SerializeFormat format, const Extensible* container, void* item);
void unserialize(SerializeFormat format, Extensible* container, const std::string& value);