diff options
author | BogDan Vatra <bogdan@kde.org> | 2019-08-20 10:05:43 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kde.org> | 2019-08-23 09:29:11 +0300 |
commit | 3f603906b425152fe41e3b16d91fb25d0b0f0823 (patch) | |
tree | c58e0f13e8c0a160a0f2e0050263e7f40c8cfe1b | |
parent | 45f681e8183fc876f5943495edb18edf78f29158 (diff) |
Android: Set RTLD_NODELETE on API 23+
Change-Id: Ia4b0a6abf862e79b6d7b4c2368f44de0d05a65e9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 84fcc53d52..85ada9197c 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -52,6 +52,10 @@ # include <private/qcore_mac_p.h> #endif +#ifdef Q_OS_ANDROID +# include <private/qjnihelpers_p.h> +#endif + QT_BEGIN_NAMESPACE static QString qdlerror() @@ -157,9 +161,12 @@ bool QLibraryPrivate::load_sys() // Do not unload the library during dlclose(). Consequently, the // library's specific static variables are not reinitialized if the // library is reloaded with dlopen() at a later time. -#if defined(RTLD_NODELETE) && !defined(Q_OS_ANDROID) +#if defined(RTLD_NODELETE) if (loadHints & QLibrary::PreventUnloadHint) { - dlFlags |= RTLD_NODELETE; +# ifdef Q_OS_ANDROID // RTLD_NODELETE flag is supported by Android 23+ + if (QtAndroidPrivate::androidSdkVersion() > 22) +# endif + dlFlags |= RTLD_NODELETE; } #endif |