Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 918029899 for ; Fri, 22 Feb 2013 18:16:36 +0000 (UTC) Received: (qmail 1949 invoked by uid 500); 22 Feb 2013 18:16:36 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 1917 invoked by uid 500); 22 Feb 2013 18:16:36 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 1910 invoked by uid 99); 22 Feb 2013 18:16:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2013 18:16:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2013 18:16:33 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 05E0B23888CD; Fri, 22 Feb 2013 18:16:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1449155 - /activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/tcp/TcpTransportTest.cpp Date: Fri, 22 Feb 2013 18:16:13 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130222181614.05E0B23888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Fri Feb 22 18:16:13 2013 New Revision: 1449155 URL: http://svn.apache.org/r1449155 Log: fix leak in test Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/tcp/TcpTransportTest.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/tcp/TcpTransportTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/tcp/TcpTransportTest.cpp?rev=1449155&r1=1449154&r2=1449155&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/tcp/TcpTransportTest.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/tcp/TcpTransportTest.cpp Fri Feb 22 18:16:13 2013 @@ -152,12 +152,17 @@ void TcpTransportTest::setUp() { //////////////////////////////////////////////////////////////////////////////// void TcpTransportTest::tearDown() { - if (server == NULL) { - return; + try { + if (server == NULL) { + return; + } + + server->stop(); + server->waitUntilStopped(); + delete server; + } catch (...) { + delete server; } - - server->stop(); - server->waitUntilStopped(); } ////////////////////////////////////////////////////////////////////////////////