From 6613fc311fc690110bf0a411ceb593f081e0ab49 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 6 Jun 2015 20:10:23 +0100 Subject: Tweaks while tracking down Column leak --- project2/common/columns.h | 4 +++- project2/common/rowSet.cpp | 8 -------- project2/common/rowSet.h | 4 ++-- project2/common/sourceObject.cpp | 4 ---- project2/common/sourceObject.h | 2 +- project2/common/variables.cpp | 4 ---- project2/common/variables.h | 2 +- 7 files changed, 7 insertions(+), 21 deletions(-) diff --git a/project2/common/columns.h b/project2/common/columns.h index bc62447..d3e2c97 100644 --- a/project2/common/columns.h +++ b/project2/common/columns.h @@ -10,6 +10,7 @@ class Column : public IntrusivePtrBase { public: Column(unsigned int idx, ScriptNodePtr p); Column(unsigned int i, const Glib::ustring & n, const Variable & v = Variable(Null())); + virtual ~Column() = default; static Column * make(unsigned int idx, ScriptNodePtr p); @@ -21,7 +22,8 @@ class Column : public IntrusivePtrBase { struct byColIdx {}; struct byColName {}; -typedef boost::multi_index::multi_index_container, +typedef boost::intrusive_ptr ColumnPtr; +typedef boost::multi_index::multi_index_container, BOOST_MULTI_INDEX_MEMBER(Column, const std::string, key)>, diff --git a/project2/common/rowSet.cpp b/project2/common/rowSet.cpp index 6ec2f94..702aec1 100644 --- a/project2/common/rowSet.cpp +++ b/project2/common/rowSet.cpp @@ -13,19 +13,11 @@ RowSet::RowSet(ScriptNodePtr p) : { } -RowSet::~RowSet() -{ -} - RowState::RowState() : rowNum(0) { } -RowState::~RowState() -{ -} - void RowState::process(const RowProcessorCallback & rp, bool r) { diff --git a/project2/common/rowSet.h b/project2/common/rowSet.h index 50dd3fd..e6793c5 100644 --- a/project2/common/rowSet.h +++ b/project2/common/rowSet.h @@ -24,7 +24,7 @@ class RowSet : public SourceObject { SimpleNumericException(FieldOutOfRange); RowSet(ScriptNodePtr); - virtual ~RowSet() = 0; + virtual ~RowSet() = default; virtual void execute(const Glib::ustring &, const RowProcessorCallback &, ExecContext *) const = 0; }; @@ -32,7 +32,7 @@ class RowSet : public SourceObject { class RowState { public: RowState(); - virtual ~RowState(); + virtual ~RowState() = default; typedef boost::function0 RowAttribute; typedef boost::function3 ColumnAction; diff --git a/project2/common/sourceObject.cpp b/project2/common/sourceObject.cpp index aa81d01..6ddec89 100644 --- a/project2/common/sourceObject.cpp +++ b/project2/common/sourceObject.cpp @@ -23,10 +23,6 @@ SourceObject::SourceObject(const std::string & n) : { } -SourceObject::~SourceObject() -{ -} - void SourceObject::loadComplete(const CommonObjects *) { diff --git a/project2/common/sourceObject.h b/project2/common/sourceObject.h index 935cead..1af9ceb 100644 --- a/project2/common/sourceObject.h +++ b/project2/common/sourceObject.h @@ -23,7 +23,7 @@ class SourceObject : public virtual IntrusivePtrBase { SourceObject(ScriptNodePtr p); SourceObject(const std::string & name); - virtual ~SourceObject() = 0; + virtual ~SourceObject() = default; virtual void loadComplete(const CommonObjects *); diff --git a/project2/common/variables.cpp b/project2/common/variables.cpp index a2a9004..eb36d7a 100644 --- a/project2/common/variables.cpp +++ b/project2/common/variables.cpp @@ -100,10 +100,6 @@ Variable::Variable(VariableImpl * v) : { } -VariableImpl::~VariableImpl() -{ -} - Variable & Variable::operator=(const VariableType & vt) { diff --git a/project2/common/variables.h b/project2/common/variables.h index e0f1e00..cee9037 100644 --- a/project2/common/variables.h +++ b/project2/common/variables.h @@ -20,7 +20,7 @@ class VariableImpl : public IntrusivePtrBase { virtual VariableType value(ExecContext *) const = 0; protected: - virtual ~VariableImpl() = 0; + virtual ~VariableImpl() = default; }; class Variable { -- cgit v1.2.3