diff options
author | BogDan Vatra <bogdan@kde.org> | 2019-04-04 14:26:23 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kdab.com> | 2019-04-05 06:37:52 +0000 |
commit | f2d0878b82f3ab897bc1ffe9cd377ea8bd796a96 (patch) | |
tree | e0efc55bb76ca020c4306e4241fc552940db9245 | |
parent | c161203b5dd91ace4b14d46542c49115e8de8d92 (diff) | |
download | qtconnectivity-f2d0878b82f3ab897bc1ffe9cd377ea8bd796a96.tar.gz |
Fix possible leak
Change-Id: Ide883a3c354eb42ea0017e1d623843967b522083
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r-- | src/bluetooth/android/servicediscoverybroadcastreceiver.cpp | 3 |
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(); |