fix a deadlock or sporadic crash during shutdown

This commit is contained in:
Sven Czarnian
2021-08-19 08:01:22 +02:00
parent 25c6a1fa86
commit d06ec49b2e
5 changed files with 57 additions and 19 deletions

View File

@@ -21,15 +21,14 @@ namespace aman {
*/
class AircraftReporter {
private:
bool m_initialized;
zmq::socket_t m_socket;
std::unique_ptr<zmq::socket_t> m_socket;
AircraftReporter() noexcept;
template <typename T>
bool setSocketKey(const std::string& key, T entry) {
try {
this->m_socket.set(entry, key);
this->m_socket->set(entry, key);
return true;
}
catch (std::exception&) {