QJniObject: fix binary compatibility breakage

Amends 601dbd6499, which changed the
signature of the private callVoidMethodV function. However, that
function got called in a public template member function, so callsites
depended on the private function to be present. By changing the function
signature, we broke binary compatibility.

Bring the original function back and implement the variadic overload
through it.

Fixes: QTBUG-109428
Pick-to: 6.4 6.5
Change-Id: Ie2297e120fbeb146089c0fbe8f91f8b8d3c79713
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Volker Hilsheimer 2022-12-15 13:06:52 +01:00
parent 8892819d0c
commit f2b49789b2
2 changed files with 8 additions and 1 deletions

View File

@ -393,10 +393,15 @@ void QJniObject::callVoidMethodV(JNIEnv *env, jmethodID id, ...) const
{
va_list args;
va_start(args, id);
env->CallVoidMethodV(d->m_jobject, id, args);
callVoidMethodV(env, id, args);
va_end(args);
}
void QJniObject::callVoidMethodV(JNIEnv *env, jmethodID id, va_list args) const
{
env->CallVoidMethodV(d->m_jobject, id, args);
}
jmethodID QJniObject::getCachedMethodID(JNIEnv *env,
jclass clazz,
const QByteArray &className,

View File

@ -434,6 +434,8 @@ private:
const char *signature, bool isStatic = false);
void callVoidMethodV(JNIEnv *env, jmethodID id, ...) const;
// ### Qt 7: merge into ... overload
void callVoidMethodV(JNIEnv *env, jmethodID id, va_list args) const;
QJniObject callObjectMethodV(const char *methodName, const char *signature,
va_list args) const;