summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosh Blum2013-03-27 03:57:15 -0500
committerJosh Blum2013-03-27 03:57:15 -0500
commit479f626bd049b3237a4249ba95da788abc8de36e (patch)
tree7fe6a02f514c2876c04a40cb93c8c20159c6a03a /lib
parent66d14812e6deaedf151cdb619797f00b057a28c0 (diff)
downloadsandhi-479f626bd049b3237a4249ba95da788abc8de36e.tar.gz
sandhi-479f626bd049b3237a4249ba95da788abc8de36e.tar.bz2
sandhi-479f626bd049b3237a4249ba95da788abc8de36e.zip
gras: also release all tags and msgs on block stop
Diffstat (limited to 'lib')
-rw-r--r--lib/block_task.cpp7
-rw-r--r--lib/input_handlers.cpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index 87d0c8a..21986fc 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -36,6 +36,13 @@ void BlockActor::mark_done(void)
this->input_queues.flush_all();
this->output_queues.flush_all();
+ //release all tags and msgs
+ for (size_t i = 0; i < this->get_num_inputs(); i++)
+ {
+ this->input_msgs[i].clear();
+ this->input_tags[i].clear();
+ }
+
//tell the upstream and downstram to re-check their tokens
//this is how the other blocks know who is interested,
//and can decide based on interest to set done or not
diff --git a/lib/input_handlers.cpp b/lib/input_handlers.cpp
index e3b5203..27704fe 100644
--- a/lib/input_handlers.cpp
+++ b/lib/input_handlers.cpp
@@ -12,6 +12,7 @@ void BlockActor::handle_input_tag(const InputTagMessage &message, const Theron::
const size_t index = message.index;
//handle incoming stream tag, push into the tag storage
+ if (this->block_state == BLOCK_STATE_DONE) return;
this->input_tags[index].push_back(message.tag);
this->input_tags_changed[index] = true;
}