tng         2003/02/05 10:56:02

  Modified:    c/doc    faq-build.xml faq-parse.xml
                        program-deprecateddom.xml program-dom.xml
                        program-sax.xml program-sax2.xml
  Log:
  [Bug 11915] Utility for freeing memory.
  
  Revision  Changes    Path
  1.14      +11 -3     xml-xerces/c/doc/faq-build.xml
  
  Index: faq-build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/doc/faq-build.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- faq-build.xml     10 Jan 2003 15:47:05 -0000      1.13
  +++ faq-build.xml     5 Feb 2003 18:56:00 -0000       1.14
  @@ -300,13 +300,21 @@
     <faq title="Why does deleting a transcoded string result in assertion on 
windows?">
       <q>Why does deleting a transcoded string result in assertion on windows?</q>
       <a>
  -      <p>Both your application program and the Xerces DLL must use the same *DLL* 
version of the
  +      <p>Both your application program and the &XercesCName; DLL must use the same 
*DLL* version of the
            runtime library.  If either statically links to the runtime library, the
  -              problem will still occur.
  +              problem will still occur.</p>
   
  -         For example, for a Win32/VC6 build, the runtime library build setting MUST
  +      <p>For example, for a Win32/VC6 build, the runtime library build setting MUST
                 be "Multithreaded DLL" for release builds and "Debug Multithreaded 
DLL" for
                 debug builds.</p>
  +
  +      <p>Or for example for a Win32/BCB6 build, application need to switch to 
Multithreaded
  +         runtime to avoid such memory access violation.</p>
  +
  +      <p>To bypass such problem, instead of calling operator delete[] directly, you 
can use the
  +         provided function XMLString::release to delete any string that was 
allocated by the parser.
  +         This will ensure the string is allocated and deleted by the same DLL and 
such assertion
  +         problem should be resolved.</p>
       </a>
     </faq>
   
  
  
  
  1.55      +5 -0      xml-xerces/c/doc/faq-parse.xml
  
  Index: faq-parse.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/doc/faq-parse.xml,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- faq-parse.xml     24 Jan 2003 19:59:56 -0000      1.54
  +++ faq-parse.xml     5 Feb 2003 18:56:00 -0000       1.55
  @@ -585,6 +585,11 @@
   
         <p>Or for example for a Win32/BCB6 build, application need to switch to 
Multithreaded
            runtime to avoid such memory access violation.</p>
  +
  +      <p>To bypass such problem, instead of calling operator delete[] directly, you 
can use the
  +         provided function XMLString::release to delete any string that was 
allocated by the parser.
  +         This will ensure the string is allocated and deleted by the same DLL and 
such assertion
  +         problem should be resolved.</p>
       </a>
     </faq>
   
  
  
  
  1.9       +2 -2      xml-xerces/c/doc/program-deprecateddom.xml
  
  Index: program-deprecateddom.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/doc/program-deprecateddom.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- program-deprecateddom.xml 6 Jan 2003 21:19:42 -0000       1.8
  +++ program-deprecateddom.xml 5 Feb 2003 18:56:00 -0000       1.9
  @@ -282,7 +282,7 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Error during initialization! :\n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return 1;
           }
   
  @@ -301,7 +301,7 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (const DOM_DOMException&amp; toCatch) {
  
  
  
  1.30      +17 -17    xml-xerces/c/doc/program-dom.xml
  
  Index: program-dom.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/doc/program-dom.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- program-dom.xml   31 Jan 2003 15:50:02 -0000      1.29
  +++ program-dom.xml   5 Feb 2003 18:56:00 -0000       1.30
  @@ -210,7 +210,7 @@
          printf("Use your own copy of the oldNodeValue if want to reference the 
string later\n");
   
      // delete your own replicated string when done
  -   delete [] oldNodeValue;
  +   XMLString::release(&amp;oldNodeValue);
   
          </source>
   
  @@ -243,7 +243,7 @@
          printf("Use your own copy of the oldNodeValue if want to reference the 
string later\n");
   
      // delete your own replicated string when done
  -   delete [] oldNodeValue;
  +   XMLString::release(&amp;oldNodeValue);
   
          </source>
   
  @@ -280,7 +280,7 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Error during initialization! :\n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return 1;
           }
   
  @@ -300,14 +300,14 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (const DOMException&amp; toCatch) {
               char* message = XMLString::transcode(toCatch.msg);
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (...) {
  @@ -657,7 +657,7 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Error during initialization! :\n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return 1;
           }
   
  @@ -691,14 +691,14 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (const DOMException&amp; toCatch) {
               char* message = XMLString::transcode(toCatch.msg);
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (...) {
  @@ -1295,14 +1295,14 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (const DOMException&amp; toCatch) {
               char* message = XMLString::transcode(toCatch.msg);
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (...) {
  @@ -1575,27 +1575,27 @@
              </s4>
   
              <s4 title="Xerces Features">
  -            <anchor name="byte-order-mark"/>           
  +            <anchor name="byte-order-mark"/>
               <table>
                   <tr><th colspan="2"><em>byte-order-mark</em></th></tr>
  -                <tr><th><em>true:</em></th><td> Enable the writing of the 
Byte-Order-Mark (BOM), in the resultant XML stream. 
  +                <tr><th><em>true:</em></th><td> Enable the writing of the 
Byte-Order-Mark (BOM), in the resultant XML stream.
                                                   </td></tr>
                   <tr><th><em>false:</em></th><td> Disable the writing of BOM. 
</td></tr>
  -                <tr><th><em>note:</em></th><td> The BOM is written at the beginning 
of the resultant XML stream, 
  -                                                if and only if a DOMDocumentNode is 
rendered for serialization, 
  +                <tr><th><em>note:</em></th><td> The BOM is written at the beginning 
of the resultant XML stream,
  +                                                if and only if a DOMDocumentNode is 
rendered for serialization,
                                                   and the output encoding is among 
the encodings listed here (alias
                                                   acceptable),
                                                   UTF-16, UTF-16LE, UTF-16BE, UCS-4, 
UCS-4LE, and UCS-4BE.
  -                                                
  +
                                                   In the case of UTF-16/UCS-4, the 
system directive, ENDIANMODE_LITTLE
                                                   and ENDIANMODE_BIG (which denotes 
the host machine's endian mode),
  -                                                is refered to determine the 
appropriate BOM to be written. 
  +                                                is refered to determine the 
appropriate BOM to be written.
                   </td></tr>
                   <tr><th><em>default:</em></th><td> false </td></tr>
                   <tr><th><em>see:</em></th><td>
                   <jump href="http://www.w3.org/TR/REC-xml#sec-guessing";> XML 1.0 
Appendix F </jump>
                   for more information about BOM.
  -                </td></tr>                
  +                </td></tr>
               </table>
              </s4>
           </s3>
  
  
  
  1.12      +4 -4      xml-xerces/c/doc/program-sax.xml
  
  Index: program-sax.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/doc/program-sax.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- program-sax.xml   6 Jan 2003 21:19:42 -0000       1.11
  +++ program-sax.xml   5 Feb 2003 18:56:01 -0000       1.12
  @@ -57,7 +57,7 @@
   {
       char* message = XMLString::transcode(name);
       cout &lt;&lt; "I saw element: "&lt;&lt; message &lt;&lt; endl;
  -    delete [] message;
  +    XMLString::release(&amp;message);
   }
   
   MySAXHandler::fatalError(const SAXParseException&amp; exception)
  @@ -99,7 +99,7 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Error during initialization! :\n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return 1;
           }
   
  @@ -120,14 +120,14 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (const SAXParseException&amp; toCatch) {
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (...) {
  
  
  
  1.17      +4 -4      xml-xerces/c/doc/program-sax2.xml
  
  Index: program-sax2.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/doc/program-sax2.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- program-sax2.xml  6 Jan 2003 21:19:42 -0000       1.16
  +++ program-sax2.xml  5 Feb 2003 18:56:02 -0000       1.17
  @@ -64,7 +64,7 @@
   {
       char* message = XMLString::transcode(name);
       cout &lt;&lt; "I saw element: "&lt;&lt; message &lt;&lt; endl;
  -    delete [] message;
  +    XMLString::release(&amp;message);
   }
   
   MySAX2Handler::fatalError(const SAXParseException&amp; exception)
  @@ -108,7 +108,7 @@
               cout &lt;&lt; "Error during initialization! :\n"
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return 1;
           }
   
  @@ -128,14 +128,14 @@
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (const SAXParseException&amp; toCatch) {
               char* message = XMLString::transcode(toCatch.getMessage());
               cout &lt;&lt; "Exception message is: \n"
                    &lt;&lt; message &lt;&lt; "\n";
  -            delete [] message;
  +            XMLString::release(&amp;message);
               return -1;
           }
           catch (...) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to