From 74e12fcef682acdbec6c3f4a3fb29b7583e7d1b6 Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Wed, 11 Aug 2010 16:08:26 -0700 Subject: Ignore upcall_flush for channels that are disassociated from ports. This makes task-comm-10 break a little less hard, but it still leaks because messages pending in the channel are never freed. --- src/rt/rust_upcall.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/rt/rust_upcall.cpp') diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 90d6f6d9037..01eaf744843 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -116,6 +116,14 @@ upcall_flush_chan(rust_task *task, rust_chan *chan) { return; } + // We cannot flush if the target port was dropped. + if (chan->is_associated() == false) { + return; + } + + A(dom, chan->is_associated(), + "Channel should be associated to a port."); + A(dom, chan->port->is_proxy() == false, "Channels to remote ports should be flushed automatically."); -- cgit 1.4.1-3-g733a5