summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bluetooth/android/servicediscoverybroadcastreceiver.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp b/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
index be1953d5..283db623 100644
--- a/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
+++ b/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
@@ -99,7 +99,6 @@ QList<QBluetoothUuid> ServiceDiscoveryBroadcastReceiver::convertParcelableArray(
{
QList<QBluetoothUuid> result;
QAndroidJniEnvironment env;
- QAndroidJniObject p;
jobjectArray parcels = parcelUuidArray.object<jobjectArray>();
if (!parcels)
@@ -107,7 +106,7 @@ QList<QBluetoothUuid> ServiceDiscoveryBroadcastReceiver::convertParcelableArray(
jint size = env->GetArrayLength(parcels);
for (int i = 0; i < size; i++) {
- p = env->GetObjectArrayElement(parcels, i);
+ auto p = QAndroidJniObject::fromLocalRef(env->GetObjectArrayElement(parcels, i));
QBluetoothUuid uuid(p.callObjectMethod<jstring>("toString").toString());
//qCDebug(QT_BT_ANDROID) << uuid.toString();