diff options
Diffstat (limited to 'libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx')
-rw-r--r-- | libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx b/libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx index 11261a6..f812526 100644 --- a/libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx +++ b/libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx @@ -5,6 +5,10 @@ #include <xsde/cxx/serializer/non-validating/idrefs.hxx> +#ifdef XSDE_CUSTOM_ALLOCATOR +# include <xsde/cxx/allocator.hxx> +#endif + namespace xsde { namespace cxx @@ -16,8 +20,16 @@ namespace xsde idrefs_simpl:: ~idrefs_simpl () { - if (free_) - delete const_cast<string_sequence*> (value_); + if (free_ && value_) + { + string_sequence* v = const_cast<string_sequence*> (value_); +#ifndef XSDE_CUSTOM_ALLOCATOR + delete v; +#else + v->~string_sequence (); + cxx::free (v); +#endif + } } void idrefs_simpl:: @@ -91,7 +103,13 @@ namespace xsde if (free_) { - delete const_cast<string_sequence*> (value_); + string_sequence* v = const_cast<string_sequence*> (value_); +#ifndef XSDE_CUSTOM_ALLOCATOR + delete v; +#else + v->~string_sequence (); + cxx::free (v); +#endif value_ = 0; } } @@ -106,4 +124,3 @@ namespace xsde } } } - |