activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r862551 - in /websites/production/activemq/content: cache/docs.pageCache cms/cms-api-overview.html
Date Tue, 21 May 2013 00:22:31 GMT
Author: buildbot
Date: Tue May 21 00:22:31 2013
New Revision: 862551

Log:
Production update by buildbot for activemq

Modified:
    websites/production/activemq/content/cache/docs.pageCache
    websites/production/activemq/content/cms/cms-api-overview.html

Modified: websites/production/activemq/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/activemq/content/cms/cms-api-overview.html
==============================================================================
--- websites/production/activemq/content/cms/cms-api-overview.html (original)
+++ websites/production/activemq/content/cms/cms-api-overview.html Tue May 21 00:22:31 2013
@@ -584,38 +584,18 @@ using namespace std;
 
     void cleanup(){
 
-        <span class="code-comment">//*************************************************
-</span>        <span class="code-comment">// Always close destination, consumers
and producers before
-</span>        <span class="code-comment">// you destroy their sessions and connection.
-</span>        <span class="code-comment">//*************************************************
-</span>
-        <span class="code-comment">// Destroy resources.
-</span>        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( destination != NULL ) delete
destination;
-        }<span class="code-keyword">catch</span> (CMSException&amp; e) {}
-        destination = NULL;
-
-        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( consumer != NULL ) delete consumer;
-        }<span class="code-keyword">catch</span> (CMSException&amp; e) {}
-        consumer = NULL;
-
-        <span class="code-comment">// Close open resources.
-</span>        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( session != NULL ) session-&gt;close();
-            <span class="code-keyword">if</span>( connection != NULL ) connection-&gt;close();
-        }<span class="code-keyword">catch</span> (CMSException&amp; e) {}
-
-        <span class="code-comment">// Now Destroy them
-</span>        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( session != NULL ) delete session;
-        }<span class="code-keyword">catch</span> (CMSException&amp; e) {}
-        session = NULL;
-
-        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( connection != NULL ) delete
connection;
-        }<span class="code-keyword">catch</span> (CMSException&amp; e) {}
-        connection = NULL;
+        <span class="code-keyword">try</span> {
+            <span class="code-keyword">if</span>( connection != NULL ) {
+                connection-&gt;close();
+            }
+        } <span class="code-keyword">catch</span> ( CMSException&amp; e )
{ 
+            e.printStackTrace(); 
+        }
+
+        delete destination;
+        delete consumer;
+        delete session;
+        delete connection;
     }
 };
 
@@ -837,32 +817,18 @@ using namespace std;
 
     void cleanup(){
 
-        <span class="code-comment">// Destroy resources.
-</span>        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( destination != NULL ) delete
destination;
-        }<span class="code-keyword">catch</span> ( CMSException&amp; e )
{ e.printStackTrace(); }
-        destination = NULL;
-
-        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( producer != NULL ) delete producer;
-        }<span class="code-keyword">catch</span> ( CMSException&amp; e )
{ e.printStackTrace(); }
-        producer = NULL;
-
-        <span class="code-comment">// Close open resources.
-</span>        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( session != NULL ) session-&gt;close();
-            <span class="code-keyword">if</span>( connection != NULL ) connection-&gt;close();
-        }<span class="code-keyword">catch</span> ( CMSException&amp; e )
{ e.printStackTrace(); }
-
-        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( session != NULL ) delete session;
-        }<span class="code-keyword">catch</span> ( CMSException&amp; e )
{ e.printStackTrace(); }
-        session = NULL;
-
-        <span class="code-keyword">try</span>{
-            <span class="code-keyword">if</span>( connection != NULL ) delete
connection;
-        }<span class="code-keyword">catch</span> ( CMSException&amp; e )
{ e.printStackTrace(); }
-        connection = NULL;
+        <span class="code-keyword">try</span> {
+            <span class="code-keyword">if</span>( connection != NULL ) {
+                connection-&gt;close();
+            }
+        } <span class="code-keyword">catch</span> ( CMSException&amp; e )
{ 
+            e.printStackTrace(); 
+        }
+
+        delete destination;
+        delete producer;
+        delete session;
+        delete connection;
     }
 };
 



Mime
View raw message