Skip to content

Commit 8c73eb4

Browse files
committed
refactor: Remove unused code
This was only used for Qt 5.8 on Win.
1 parent a65cc43 commit 8c73eb4

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

src/misc/dbus.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,6 @@
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-
286
QDBusArgument &operator<<(QDBusArgument &arg, const std::string &s)
297
{
308
arg.beginStructure();

src/misc/dbus.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)