Skip to content

Commit

Permalink
Add sleep to InterProcessForwarder destructor to temporarily workarou…
Browse files Browse the repository at this point in the history
…nd problem with deleting inner() before the unsubscribe_all() is processed by the Portal
  • Loading branch information
tsaubergine committed Jul 29, 2021
1 parent 68e5efa commit 81903d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/middleware/transport/interprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,13 @@ class InterProcessForwarder
std::shared_ptr<const goby::middleware::protobuf::SerializerTransporterMessage>
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;

Expand Down

0 comments on commit 81903d4

Please sign in to comment.