summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@theqtcompany.com>2015-02-13 12:18:33 +0100
committerChristian Stromme <christian.stromme@theqtcompany.com>2015-02-17 14:30:32 +0000
commit02c5657a7d6d30c6e874e29a0adcc38b58a45b7d (patch)
tree59b5be095cb8d393ee0e6b9b64b9065b48cd6d61 /src/plugins/bearer
parent921dd85c7a90bf7432d50bd9f631d065f5281d34 (diff)
Android: Fix local ref handling.
We where allowing conversion from jobject to QJNIObject without taking ownership of the jobject. Since we are managing the JNI environment we should not allow conversions without having the option of taking ownership of the local ref. This is now done by making the conversions explicit, i.e., local refs are converted through QJNIObjectPrivate::fromLocalRef() and global refs through the QJNIObjectPrivate's jobject constructor. This change breaks SC, but the API is private and no usage have been found outside QtBase. Change-Id: I3175f171699ec3f8e65144aaebc6246bc6e5bb4d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/plugins/bearer')
-rw-r--r--src/plugins/bearer/android/src/wrappers/androidconnectivitymanager.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/bearer/android/src/wrappers/androidconnectivitymanager.cpp b/src/plugins/bearer/android/src/wrappers/androidconnectivitymanager.cpp
index 4beb2e581b..c6a013ebed 100644
--- a/src/plugins/bearer/android/src/wrappers/androidconnectivitymanager.cpp
+++ b/src/plugins/bearer/android/src/wrappers/androidconnectivitymanager.cpp
@@ -295,8 +295,7 @@ QList<AndroidNetworkInfo> AndroidConnectivityManager::getAllNetworkInfo() const
if (exceptionCheckAndClear(env))
break;
- list << AndroidNetworkInfo(lref);
- env->DeleteLocalRef(lref);
+ list << AndroidNetworkInfo(QJNIObjectPrivate::fromLocalRef(lref));
}
return list;