aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-07-24 12:40:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-07-24 12:40:01 +0200
commit94cba986108a0e0f42295572ca42c356d59328d7 (patch)
treeada11354802ef98572cfc7041075766666e472be
parent19a0faf4316a89e0a4ced32b8d3ea4b4ba9c3b18 (diff)
Fix bug in C++/Parser Expat support
-rw-r--r--libxsd/xsd/cxx/parser/expat/elements.hxx4
-rw-r--r--libxsd/xsd/cxx/parser/expat/elements.txx11
2 files changed, 10 insertions, 5 deletions
diff --git a/libxsd/xsd/cxx/parser/expat/elements.hxx b/libxsd/xsd/cxx/parser/expat/elements.hxx
index 86e7a73..c03bf1a 100644
--- a/libxsd/xsd/cxx/parser/expat/elements.hxx
+++ b/libxsd/xsd/cxx/parser/expat/elements.hxx
@@ -51,7 +51,9 @@ namespace xsd
}
};
- typedef std::unique_ptr<XML_ParserStruct> parser_auto_ptr;
+ typedef
+ std::unique_ptr<XML_ParserStruct, parser_deleter>
+ parser_auto_ptr;
#else
// Simple auto pointer for Expat's XML_Parser object.
//
diff --git a/libxsd/xsd/cxx/parser/expat/elements.txx b/libxsd/xsd/cxx/parser/expat/elements.txx
index d3fc0d9..ef9adb7 100644
--- a/libxsd/xsd/cxx/parser/expat/elements.txx
+++ b/libxsd/xsd/cxx/parser/expat/elements.txx
@@ -283,9 +283,10 @@ namespace xsd
throw std::bad_alloc ();
if (system_id || public_id)
- parse_begin (parser, system_id ? *system_id : *public_id, eh);
+ parse_begin (
+ parser.get (), system_id ? *system_id : *public_id, eh);
else
- parse_begin (parser, eh);
+ parse_begin (parser.get (), eh);
// Temporarily unset the exception failbit. Also clear the
// fail bit when we reset the old state if it was caused
@@ -310,8 +311,10 @@ namespace xsd
break;
}
- if (XML_Parse (
- parser, buf, is.gcount (), is.eof ()) == XML_STATUS_ERROR)
+ if (XML_Parse (parser.get (),
+ buf,
+ is.gcount (),
+ is.eof ()) == XML_STATUS_ERROR)
{
r = false;
break;