summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/gras/block.hpp2
-rw-r--r--include/gras/element.hpp3
-rw-r--r--include/gras/hier_block.hpp2
-rw-r--r--include/gras/top_block.hpp2
-rw-r--r--lib/block.cpp5
-rw-r--r--lib/element.cpp5
-rw-r--r--lib/hier_block.cpp5
-rw-r--r--lib/top_block.cpp5
-rw-r--r--python/gras/GRAS_Block.i3
-rw-r--r--python/gras/GRAS_HierBlock.i8
10 files changed, 37 insertions, 3 deletions
diff --git a/include/gras/block.hpp b/include/gras/block.hpp
index 7595345..4211255 100644
--- a/include/gras/block.hpp
+++ b/include/gras/block.hpp
@@ -113,6 +113,8 @@ struct GRAS_API Block : Element
//! Create a new block given the name
Block(const std::string &name);
+ virtual ~Block(void);
+
/*******************************************************************
* Deal with input and output port configuration
******************************************************************/
diff --git a/include/gras/element.hpp b/include/gras/element.hpp
index 633ab84..0bebc14 100644
--- a/include/gras/element.hpp
+++ b/include/gras/element.hpp
@@ -23,13 +23,14 @@ struct Block;
struct GRAS_API Element : ElementBase, boost::enable_shared_from_this<Element>
{
-
//! Create an empty element
Element(void);
//! Creates a new element given the name
Element(const std::string &name);
+ /*virtual*/ ~Element(void);
+
/*******************************************************************
* identification interface
******************************************************************/
diff --git a/include/gras/hier_block.hpp b/include/gras/hier_block.hpp
index 398024e..73eeabd 100644
--- a/include/gras/hier_block.hpp
+++ b/include/gras/hier_block.hpp
@@ -14,6 +14,8 @@ struct GRAS_API HierBlock : Element
HierBlock(const std::string &name);
+ virtual ~HierBlock(void);
+
/*******************************************************************
* connection flow interface
******************************************************************/
diff --git a/include/gras/top_block.hpp b/include/gras/top_block.hpp
index f99d341..17f1e30 100644
--- a/include/gras/top_block.hpp
+++ b/include/gras/top_block.hpp
@@ -36,6 +36,8 @@ struct GRAS_API TopBlock : HierBlock
TopBlock(const std::string &name);
+ virtual ~TopBlock(void);
+
//! Get the global block config settings
const GlobalBlockConfig &global_config(void) const;
diff --git a/lib/block.cpp b/lib/block.cpp
index d2f0a0d..5bb959b 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -46,6 +46,11 @@ Block::Block(const std::string &name):
this->set_buffer_affinity(-1);
}
+Block::~Block(void)
+{
+ //NOP
+}
+
void ElementImpl::block_cleanup(void)
{
//wait for actor to chew through enqueued messages
diff --git a/lib/element.cpp b/lib/element.cpp
index 4adc92c..f291310 100644
--- a/lib/element.cpp
+++ b/lib/element.cpp
@@ -26,6 +26,11 @@ Element::Element(const std::string &name)
if (GENESIS) std::cerr << "New element: " << to_string() << std::endl;
}
+Element::~Element(void)
+{
+ //NOP
+}
+
ElementImpl::~ElementImpl(void)
{
if (this->executor) this->top_block_cleanup();
diff --git a/lib/hier_block.cpp b/lib/hier_block.cpp
index b7ffe4c..4c0aef3 100644
--- a/lib/hier_block.cpp
+++ b/lib/hier_block.cpp
@@ -18,6 +18,11 @@ HierBlock::HierBlock(const std::string &name):
(*this)->topology = boost::shared_ptr<Apology::Topology>(new Apology::Topology());
}
+HierBlock::~HierBlock(void)
+{
+ //NOP
+}
+
void ElementImpl::hier_block_cleanup(void)
{
this->topology->clear_all();
diff --git a/lib/top_block.cpp b/lib/top_block.cpp
index 10d5ef2..5370920 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -30,6 +30,11 @@ TopBlock::TopBlock(const std::string &name):
<< std::flush;
}
+TopBlock::~TopBlock(void)
+{
+ //NOP
+}
+
void ElementImpl::top_block_cleanup(void)
{
this->pre_post_all_set_prio();
diff --git a/python/gras/GRAS_Block.i b/python/gras/GRAS_Block.i
index b4d8293..84d6548 100644
--- a/python/gras/GRAS_Block.i
+++ b/python/gras/GRAS_Block.i
@@ -79,7 +79,8 @@ struct BlockPython : Block
virtual ~BlockPython(void)
{
- //NOP
+ PyTSPhondler phil;
+ this->reset();
}
void notify_active(void)
diff --git a/python/gras/GRAS_HierBlock.i b/python/gras/GRAS_HierBlock.i
index 12a5952..21d087e 100644
--- a/python/gras/GRAS_HierBlock.i
+++ b/python/gras/GRAS_HierBlock.i
@@ -45,7 +45,7 @@ struct TopBlockPython : TopBlock
//NOP
}
- ~TopBlockPython(void)
+ virtual ~TopBlockPython(void)
{
PyTSPhondler phil;
this->reset();
@@ -89,6 +89,12 @@ struct HierBlockPython : HierBlock
{
//NOP
}
+
+ virtual ~HierBlockPython(void)
+ {
+ PyTSPhondler phil;
+ this->reset();
+ }
};
}