From 2e8754b467914eb554a886317b88a3a654e0f58d Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Fri, 24 Aug 2012 18:19:24 -0500 Subject: Memory leak in splaytree and testcase. Change-Id: I15515e3f63c8c24dc79da760b47411bf7ca6577a Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1579 Tested-by: Jenkins Server Reviewed-by: Terry J. Opie Reviewed-by: Douglas R. Gilbert Reviewed-by: A. Patrick Williams III --- src/include/util/impl/splaytree.H | 55 +++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 23 deletions(-) (limited to 'src/include/util/impl') diff --git a/src/include/util/impl/splaytree.H b/src/include/util/impl/splaytree.H index 9159ddddc..8b3743b50 100644 --- a/src/include/util/impl/splaytree.H +++ b/src/include/util/impl/splaytree.H @@ -1,26 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/util/impl/splaytree.h $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2012 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END - +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/util/impl/splaytree.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef __UTIL_IMPL_SPLAYTREE_H #define __UTIL_IMPL_SPLAYTREE_H @@ -104,6 +104,15 @@ namespace Util new (&data_T()) T(); }; + /** Default destructor. + * + * Call destructor on the child object. + */ + ~Node() + { + data_T().~T(); + } + /** Copy constructor from a Node. * * Initializes the node-links and copies the data storage area -- cgit v1.2.3