aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-03-22 11:19:12 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-03-22 12:57:17 +0000
commit8676559bee9c849a6e1950b786da59eaafd2b1cc (patch)
tree8e169f8594907d9dc87575fa1c7c85b5b06836d3 /src
parent965e83dad1f9219220b14bb3fe6e6e2b4c27d667 (diff)
De-inline ~QAndroidJniObject() dtor
By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info strucures for the class are pinned to a single TU. This prevents false negative dynamic_cast and catch evaluation. Since it is already exported, users of the class are unaffected by the change, but since it's public API, and the dtors may have been de-virtualized and inlined into application code, we need to avoid adding code to the out-of-line dtor until Qt 6. Task-number: QTBUG-45582 Change-Id: I60273f7352be0d5a45a94828647d61f0ec9f1d79 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/androidextras/jni/qandroidjniobject.cpp6
-rw-r--r--src/androidextras/jni/qandroidjniobject.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/androidextras/jni/qandroidjniobject.cpp b/src/androidextras/jni/qandroidjniobject.cpp
index ebdd73d..2daed68 100644
--- a/src/androidextras/jni/qandroidjniobject.cpp
+++ b/src/androidextras/jni/qandroidjniobject.cpp
@@ -310,10 +310,12 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QAndroidJniObject::~QAndroidJniObject()
-
Destroys the QAndroidJniObject and releases any references held by the QAndroidJniObject.
*/
+QAndroidJniObject::~QAndroidJniObject()
+{
+ // must be empty until ### Qt 6
+}
/*!
\fn T QAndroidJniObject::callMethod(const char *methodName, const char *signature, ...) const
diff --git a/src/androidextras/jni/qandroidjniobject.h b/src/androidextras/jni/qandroidjniobject.h
index c4922d5..73fa68a 100644
--- a/src/androidextras/jni/qandroidjniobject.h
+++ b/src/androidextras/jni/qandroidjniobject.h
@@ -52,7 +52,7 @@ public:
explicit QAndroidJniObject(jclass clazz);
QAndroidJniObject(jclass clazz, const char *sig, ...);
QAndroidJniObject(jobject obj);
- ~QAndroidJniObject() { }
+ ~QAndroidJniObject();
template <typename T>
inline T object() const { return static_cast<T>(javaObject()); }