From 00d6cd2440c5b9a0aa9dc7b247b747676c361219 Mon Sep 17 00:00:00 2001 From: sears Date: Thu, 5 Aug 2010 17:39:31 +0000 Subject: [PATCH] added destructor to diskTreeComponent (fixes file handle / memory leak) git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@954 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe --- diskTreeComponent.cpp | 4 ++++ diskTreeComponent.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/diskTreeComponent.cpp b/diskTreeComponent.cpp index 09c34a2..90539a5 100644 --- a/diskTreeComponent.cpp +++ b/diskTreeComponent.cpp @@ -357,6 +357,10 @@ diskTreeComponent::internalNodes::internalNodes(int xid, recordid root, recordid datapage_alloc(new RegionAllocator(xid, datapage_state)) { } +diskTreeComponent::internalNodes::~internalNodes() { + delete internal_node_alloc; + delete datapage_alloc; +} /* adding pages: diff --git a/diskTreeComponent.h b/diskTreeComponent.h index 54c16a6..df237e7 100644 --- a/diskTreeComponent.h +++ b/diskTreeComponent.h @@ -81,7 +81,7 @@ class diskTreeComponent { internalNodes(int xid, pageid_t internal_region_size, pageid_t datapage_region_size, pageid_t datapage_size); internalNodes(int xid, recordid root, recordid internal_node_state, recordid datapage_state); - + ~internalNodes(); void print_tree(int xid); //returns the id of the data page that could contain the given key