summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--api/plugin-support.hpp2
-rw-r--r--gui/main.cpp3
-rw-r--r--proto-fsuipc/ftnoir_protocol_fsuipc.cpp1
-rw-r--r--proto-simconnect/ftnoir_protocol_sc.cpp1
4 files changed, 5 insertions, 2 deletions
diff --git a/api/plugin-support.hpp b/api/plugin-support.hpp
index acba925c..85b8653c 100644
--- a/api/plugin-support.hpp
+++ b/api/plugin-support.hpp
@@ -62,7 +62,7 @@ struct dylib final
return;
handle.setFileName(filename_);
- handle.setLoadHints(QLibrary::DeepBindHint | QLibrary::ResolveAllSymbolsHint);
+ handle.setLoadHints(QLibrary::DeepBindHint | QLibrary::ResolveAllSymbolsHint | QLibrary::PreventUnloadHint);
if (check(!handle.load()))
return;
diff --git a/gui/main.cpp b/gui/main.cpp
index 3739232f..5d43cc14 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -202,7 +202,8 @@ main(int argc, char** argv)
while (false);
// msvc crashes in Qt plugin system's dtor
-#if defined(_MSC_VER)
+ // Note: QLibrary::PreventUnloadHint seems to workaround it
+#if defined(_MSC_VER) && 0
qDebug() << "exit: terminating";
TerminateProcess(GetCurrentProcess(), 0);
#endif
diff --git a/proto-fsuipc/ftnoir_protocol_fsuipc.cpp b/proto-fsuipc/ftnoir_protocol_fsuipc.cpp
index bdb67c3f..64a14f5f 100644
--- a/proto-fsuipc/ftnoir_protocol_fsuipc.cpp
+++ b/proto-fsuipc/ftnoir_protocol_fsuipc.cpp
@@ -147,6 +147,7 @@ void fsuipc::pose(const double *headpose ) {
module_status fsuipc::initialize()
{
FSUIPCLib.setFileName( s.LocationOfDLL );
+ FSUIPCLib.setLoadHints(QLibrary::PreventUnloadHint);
if (FSUIPCLib.load() != true)
return error(_("Can't load fsuipc at '%1'").arg(s.LocationOfDLL));
diff --git a/proto-simconnect/ftnoir_protocol_sc.cpp b/proto-simconnect/ftnoir_protocol_sc.cpp
index 1a844429..812fdcb3 100644
--- a/proto-simconnect/ftnoir_protocol_sc.cpp
+++ b/proto-simconnect/ftnoir_protocol_sc.cpp
@@ -170,6 +170,7 @@ module_status simconnect::initialize()
if (ctx.is_ok())
{
SCClientLib.setFileName("SimConnect.dll");
+ SCClientLib.setLoadHints(QLibrary::PreventUnloadHint);
if (!SCClientLib.load())
return error(tr("dll load failed -- %1").arg(SCClientLib.errorString()));
}