OK, I tracked down the problem I was having with XML.  It has to do with the tmp variable in 'disk_writer_xml::value_to_xmlChar'.  It is being returned as the value, but it is a class, so it is destructed at the end of the function.  On my computer that memory is being overwritten before the call to xmlSetProp.  Attached is a 'hack' to fix this.  It isn't a perfect solution because if someone carries around the pointer returned, it will change with each call to the function.  Let me know if this doesn't make any sense.  It's getting late here and a little hard to concentrate.

Tyler
Index: src/base/diskwriter_xml.cc
===================================================================
RCS file: /sources/adonthell/adonthell/src/base/diskwriter_xml.cc,v
retrieving revision 1.5
diff -u -r1.5 diskwriter_xml.cc
--- src/base/diskwriter_xml.cc	19 Oct 2006 05:58:00 -0000	1.5
+++ src/base/diskwriter_xml.cc	27 Oct 2006 06:50:19 -0000
@@ -565,6 +565,7 @@
 xmlChar *disk_writer_xml::value_to_xmlChar (const flat::data_type & type, void *value, const u_int32 & size) const
 {
 	std::ostringstream tmp;
+    static string ret;
     switch (type)
     {
         // write boolean type
@@ -651,5 +652,6 @@
         }
     }
     
-    return (xmlChar*) tmp.str().c_str();
+    ret = tmp.str();
+    return (xmlChar*) ret.c_str();
 }
_______________________________________________
Adonthell-devel mailing list
Adonthell-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/adonthell-devel

Reply via email to