From 81903d4088c150de6d854b45abdef109777ddd63 Mon Sep 17 00:00:00 2001 From: Toby Schneider Date: Thu, 29 Jul 2021 16:14:51 -0400 Subject: [PATCH] Add sleep to InterProcessForwarder destructor to temporarily workaround problem with deleting inner() before the unsubscribe_all() is processed by the Portal --- src/middleware/transport/interprocess.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/middleware/transport/interprocess.h b/src/middleware/transport/interprocess.h index f068f0c4..3db3d1f5 100644 --- a/src/middleware/transport/interprocess.h +++ b/src/middleware/transport/interprocess.h @@ -310,7 +310,13 @@ class InterProcessForwarder std::shared_ptr msg) { _receive_regex_data_forwarded(msg); }); } - virtual ~InterProcessForwarder() { this->unsubscribe_all(); } + virtual ~InterProcessForwarder() + { + this->unsubscribe_all(); + + // TODO - remove by adding in an explicit handshake with the unsubscribe_all publication so that we don't delete ourself (and thus our inner()) before the Portal has deleted all the subscriptions + usleep(1e5); + } friend Base;