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

@@ -20,7 +20,9 @@
#include <aman/config/IdentifierFileFormat.h>
#include <protobuf/AircraftReport.pb.h>
#include <zmq.h>
#include "com/ZmqContext.h"
#include "PlugIn.h"
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
@@ -59,6 +61,8 @@ PlugIn::PlugIn() :
return;
}
ZmqContext::instance().initialize();
if (false == AircraftReporter::instance().initialize(this->m_configuration)) {
this->DisplayUserMessage(PLUGIN_NAME, "ERROR", "Unable to initialize the reporter-connection to the backend", true, true, true, true, true);
return;
@@ -67,6 +71,7 @@ PlugIn::PlugIn() :
PlugIn::~PlugIn() noexcept {
AircraftReporter::instance().deinitialize();
ZmqContext::instance().deinitialize();
google::protobuf::ShutdownProtobufLibrary();
}