Author: borisk
Date: Tue Nov 17 10:19:57 2009
New Revision: 881225

URL: http://svn.apache.org/viewvc?rev=881225&view=rev
Log:
Catch and ignore exceptions in destructors (XERCESC-1898).

Modified:
    xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp
    xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp

Modified: xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp?rev=881225&r1=881224&r2=881225&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/LocalFileFormatTarget.cpp Tue Nov 17 
10:19:57 2009
@@ -77,11 +77,18 @@
 
 LocalFileFormatTarget::~LocalFileFormatTarget()
 {
-    // flush remaining buffer before destroy
-    flushBuffer();
+    try
+    {
+        // flush remaining buffer before destroy
+        flushBuffer();
 
-    if (fSource)
-        XMLPlatformUtils::closeFile(fSource, fMemoryManager);
+        if (fSource)
+            XMLPlatformUtils::closeFile(fSource, fMemoryManager);
+    }
+    catch (...)
+    {
+      // There is nothing we can do about it here.
+    }
 
     fMemoryManager->deallocate(fDataBuf);//delete [] fDataBuf;
 }

Modified: xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp?rev=881225&r1=881224&r2=881225&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/StdOutFormatTarget.cpp Tue Nov 17 
10:19:57 2009
@@ -28,7 +28,9 @@
 {}
 
 StdOutFormatTarget::~StdOutFormatTarget()
-{}
+{
+  flush ();
+}
 
 void StdOutFormatTarget::flush()
 {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to