Index: runtime/vm/message.cc |
=================================================================== |
--- runtime/vm/message.cc (revision 36729) |
+++ runtime/vm/message.cc (working copy) |
@@ -4,8 +4,20 @@ |
#include "vm/message.h" |
+#include "vm/port.h" |
+ |
namespace dart { |
+bool Message::RedirectToDeliveryFailurePort() { |
+ if (delivery_failure_port_ == kIllegalPort) { |
+ return false; |
+ } |
+ dest_port_ = delivery_failure_port_; |
+ delivery_failure_port_ = kIllegalPort; |
+ return true; |
+} |
+ |
+ |
MessageQueue::MessageQueue() { |
head_ = NULL; |
tail_ = NULL; |
@@ -59,7 +71,11 @@ |
tail_ = NULL; |
while (cur != NULL) { |
Message* next = cur->next_; |
- delete cur; |
+ if (cur->RedirectToDeliveryFailurePort()) { |
+ PortMap::PostMessage(cur); |
+ } else { |
+ delete cur; |
+ } |
cur = next; |
} |
} |