aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/serializer/validating/nmtoken.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsde/xsde/cxx/serializer/validating/nmtoken.cxx')
-rw-r--r--libxsde/xsde/cxx/serializer/validating/nmtoken.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/libxsde/xsde/cxx/serializer/validating/nmtoken.cxx b/libxsde/xsde/cxx/serializer/validating/nmtoken.cxx
index a230b57..c2f4a12 100644
--- a/libxsde/xsde/cxx/serializer/validating/nmtoken.cxx
+++ b/libxsde/xsde/cxx/serializer/validating/nmtoken.cxx
@@ -8,6 +8,10 @@
#include <xsde/cxx/serializer/validating/nmtoken.hxx>
#include <xsde/cxx/serializer/validating/string-common.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -19,8 +23,15 @@ namespace xsde
nmtoken_simpl::
~nmtoken_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 nmtoken_simpl::
@@ -58,7 +69,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;
}
}