From 61395de775c08a4f6093d62a36b757fb21ed8aa5 Mon Sep 17 00:00:00 2001 From: prabatuty Date: Fri, 6 Feb 2009 16:12:40 +0000 Subject: [PATCH] moving destructor to cxx file --- include/Index.h | 7 +------ src/storage/Index.cxx | 9 +++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/Index.h b/include/Index.h index 6229a393..9ac9a072 100644 --- a/include/Index.h +++ b/include/Index.h @@ -104,12 +104,7 @@ class Index public: static Index* getIndex(IndexType type); static void init() { usageCount++; } - static void destroy() { - usageCount--; - if(!usageCount) { - if(!hIdx) { delete hIdx; hIdx=NULL; } - } - } + static void destroy(); virtual DbRetVal insert(TableImpl *tbl, Transaction *tr, void *indexPtr, IndexInfo *info, void *tuple, bool undoFlag)=0; virtual DbRetVal remove(TableImpl *tbl, Transaction *tr, void *indexPtr, IndexInfo *info, void *tuple, bool undoFlag)=0; virtual DbRetVal update(TableImpl *tbl, Transaction *tr, void *indexPtr, IndexInfo *info, void *tuple, bool undoFlag)=0; diff --git a/src/storage/Index.cxx b/src/storage/Index.cxx index e86bb07f..b139793a 100644 --- a/src/storage/Index.cxx +++ b/src/storage/Index.cxx @@ -34,3 +34,12 @@ Index* Index::getIndex(IndexType type) } return NULL; } +void Index::destroy() +{ + usageCount--; + if(!usageCount) { + if(!hIdx) { delete hIdx; hIdx=NULL; } + if(!tIdx) { delete tIdx; tIdx=NULL; } + } +} + -- 2.11.4.GIT