File tree Expand file tree Collapse file tree 2 files changed +1
-30
lines changed Expand file tree Collapse file tree 2 files changed +1
-30
lines changed Original file line number Diff line number Diff line change 33
44#include "misc/dbus.h"
55
6- #ifdef Q_OS_WIN
7- # include <qt_windows.h>
8-
9- # include <QDBusConnection>
10-
11- // https://blogs.msdn.microsoft.com/oldnewthing/20131105-00/?p=2733
12- // See https://bugreports.qt.io/browse/QTBUG-53031 for more details
13- // why this is necessary.
14- void preventQtDBusDllUnload()
15- {
16- // Only Qt 5.8.0 is affected.
17- if (qVersion() != QByteArray("5.8.0")) { return; }
18-
19- static HMODULE dbusDll;
20- GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_PIN,
21- reinterpret_cast<LPCTSTR>(&QDBusConnection::staticMetaObject), &dbusDll);
22- Q_ASSERT(dbusDll);
23- }
24- #else
25- void preventQtDBusDllUnload() {}
26- #endif
27-
286QDBusArgument &operator<<(QDBusArgument &arg, const std::string &s)
297{
308 arg.beginStructure();
Original file line number Diff line number Diff line change @@ -78,11 +78,4 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, QFlags<T> &value)
7878 return arg;
7979}
8080
81- // *INDENT-ON*
82-
83- //! Windows: prevents unloading of QtDBus shared library until the process is terminated.
84- //! QtDBus must have been loaded already by the calling process.
85- //! Does nothing on non-Windows platforms.
86- SWIFT_MISC_EXPORT void preventQtDBusDllUnload();
87-
88- #endif // guard
81+ #endif // SWIFT_MISC_DBUS_H
You can’t perform that action at this time.
0 commit comments