summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-04-20 14:56:35 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-04-20 14:56:35 +0200
commitddf4dd882dc55366ed3c28605507c44704732c58 (patch)
tree53ed44e61b53523cd9b2cc9f02e5ecee0a9d281b /android
parentac61d03c40ca740a395248c549c6d7e46977d88e (diff)
downloadqtlocation-mapboxgl-ddf4dd882dc55366ed3c28605507c44704732c58.tar.gz
[android] never pass garbage info to RegisterNatives()
Diffstat (limited to 'android')
-rw-r--r--android/cpp/jni.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp
index 628f24a15b..ac51884840 100644
--- a/android/cpp/jni.cpp
+++ b/android/cpp/jni.cpp
@@ -927,9 +927,7 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
return JNI_ERR;
}
- // NOTE: if you get java.lang.UnsatisfiedLinkError you likely forgot to set the size of the
- // array correctly (too large)
- std::array<JNINativeMethod, 62> methods = {{ // Can remove the extra brace in C++14
+ const std::vector<JNINativeMethod> methods = {
{"nativeCreate", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J",
reinterpret_cast<void *>(&nativeCreate)},
{"nativeDestroy", "(J)V", reinterpret_cast<void *>(&nativeDestroy)},
@@ -1014,7 +1012,7 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
{"nativeLatLngForProjectedMeters", "(JLcom/mapbox/mapboxgl/geometry/ProjectedMeters;)Lcom/mapbox/mapboxgl/geometry/LatLng;", reinterpret_cast<void *>(&nativeLatLngForProjectedMeters)},
{"nativePixelForLatLng", "(JLcom/mapbox/mapboxgl/geometry/LatLng;)Landroid/graphics/PointF;", reinterpret_cast<void *>(&nativePixelForLatLng)},
{"nativeLatLngForPixel", "(JLandroid/graphics/PointF;)Lcom/mapbox/mapboxgl/geometry/LatLng;", reinterpret_cast<void *>(&nativeLatLngForPixel)},
- }};
+ };
if (env->RegisterNatives(nativeMapViewClass, methods.data(), methods.size()) < 0) {
env->ExceptionDescribe();