Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 15358 invoked from network); 17 Jan 2005 02:54:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Jan 2005 02:54:52 -0000 Received: (qmail 92804 invoked by uid 500); 17 Jan 2005 02:54:51 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 92466 invoked by uid 500); 17 Jan 2005 02:54:50 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 92453 invoked by uid 99); 17 Jan 2005 02:54:50 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 16 Jan 2005 18:54:49 -0800 Received: (qmail 15227 invoked by uid 1852); 17 Jan 2005 02:54:48 -0000 Date: 17 Jan 2005 02:54:48 -0000 Message-ID: <20050117025448.15226.qmail@minotaur.apache.org> From: samisa@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/c/tests/auto_build/testcases/client/cpp AxisBenchClient.cpp X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N samisa 2005/01/16 18:54:48 Modified: c/tests/auto_build/testcases/client/cpp AxisBenchClient.cpp Log: Added memory clean up code segments. This is important to ensure deallocation of memory. Revision Changes Path 1.15 +23 -3 ws-axis/c/tests/auto_build/testcases/client/cpp/AxisBenchClient.cpp Index: AxisBenchClient.cpp =================================================================== RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/client/cpp/AxisBenchClient.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- AxisBenchClient.cpp 13 Jan 2005 08:59:39 -0000 1.14 +++ AxisBenchClient.cpp 17 Jan 2005 02:54:48 -0000 1.15 @@ -37,6 +37,10 @@ { AxisBench *ws; + BenchDataType *input = NULL; + BenchDataType *output = NULL; + xsd__unsignedByte* buffer = NULL; + char *endpoint = WSDL_DEFAULT_ENDPOINT; bool endpoint_set = false; int returnValue = 1; // Assume Failure @@ -51,9 +55,7 @@ } else ws = new AxisBench(); - BenchDataType *input; - BenchDataType *output; - xsd__unsignedByte* buffer; + int request = 1; input = new BenchDataType(); @@ -136,6 +138,12 @@ #endif for ( int ii = 0; ii < request ; ii++ ) { + if (output) { // Samisa: memory management BP + for (int i = 0; i < output->infos.m_Size; i++) + delete (BenchBasicDataType*)(output->infos.m_Array[i]); + delete output; + output = NULL; + } output = ws->doBenchRequest(input); } @@ -216,6 +224,18 @@ cerr << "Unknown Exception occured." << endl; if(endpoint_set) free(endpoint); + } + + // Samisa: make sure we clean up memory allocated + delete ws; + for (int i = 0; i < input->infos.m_Size; i++) + delete (BenchBasicDataType*)(input->infos.m_Array[i]); + delete input; + if (output) + { + for (i = 0; i < output->infos.m_Size; i++) + delete (BenchBasicDataType*)(output->infos.m_Array[i]); + delete output; } return returnValue;