Merge commit 'v3.3.1' into try-3.3.1
[debian/gnuradio] / gnuradio-core / src / lib / runtime / gr_top_block.cc
index 407df8bbac822600cb3637341eace7a424d822b3..09e46dfbb4bbea367911cd3c25e3d994757bfd47 100644 (file)
@@ -24,6 +24,7 @@
 #include "config.h"
 #endif
 
+#include <unistd.h>
 #include <gr_top_block.h>
 #include <gr_top_block_impl.h>
 #include <gr_io_signature.h>
@@ -32,7 +33,7 @@
 gr_top_block_sptr 
 gr_make_top_block(const std::string &name)
 {
-  return gr_top_block_sptr(new gr_top_block(name));
+  return gnuradio::get_initial_sptr(new gr_top_block(name));
 }
 
 gr_top_block::gr_top_block(const std::string &name)
@@ -46,6 +47,9 @@ gr_top_block::gr_top_block(const std::string &name)
   
 gr_top_block::~gr_top_block()
 {
+  stop();
+  wait();
+    
   delete d_impl;
 }
 
@@ -85,3 +89,9 @@ gr_top_block::unlock()
 {
   d_impl->unlock();
 }
+
+void
+gr_top_block::dump()
+{
+  d_impl->dump();
+}