diff options
Diffstat (limited to 'libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx')
-rw-r--r-- | libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx b/libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx index b1bbf29..202ac76 100644 --- a/libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx +++ b/libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx @@ -5,6 +5,10 @@ #include <xsde/cxx/serializer/non-validating/normalized-string.hxx> +#ifdef XSDE_CUSTOM_ALLOCATOR +# include <xsde/cxx/allocator.hxx> +#endif + namespace xsde { namespace cxx @@ -16,8 +20,15 @@ namespace xsde normalized_string_simpl:: ~normalized_string_simpl () { - if (free_) - delete[] const_cast<char*> (value_); + if (free_ && value_) + { + char* v = const_cast<char*> (value_); +#ifndef XSDE_CUSTOM_ALLOCATOR + delete[] v; +#else + cxx::free (v); +#endif + } } void normalized_string_simpl:: @@ -33,7 +44,12 @@ namespace xsde if (free_) { - delete[] const_cast<char*> (value_); + char* v = const_cast<char*> (value_); +#ifndef XSDE_CUSTOM_ALLOCATOR + delete[] v; +#else + cxx::free (v); +#endif value_ = 0; } } @@ -41,4 +57,3 @@ namespace xsde } } } - |