summaryrefslogtreecommitdiff
path: root/platform/android/src/style/sources/source.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/style/sources/source.cpp')
-rw-r--r--platform/android/src/style/sources/source.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/android/src/style/sources/source.cpp b/platform/android/src/style/sources/source.cpp
index 786e5cb586..485f4284e4 100644
--- a/platform/android/src/style/sources/source.cpp
+++ b/platform/android/src/style/sources/source.cpp
@@ -67,6 +67,10 @@ namespace android {
}
Source::~Source() {
+ if (ownedSource) {
+ ownedSource.reset();
+ ownedSource.release();
+ }
// Before being added to a map, the Java peer owns this C++ peer and cleans
// up after itself correctly through the jni native peer bindings.
// After being added to the map, the ownership is flipped and the C++ peer has a strong reference
@@ -137,7 +141,7 @@ namespace android {
// Release the strong reference to the java peer
assert(javaPeer);
- javaPeer.release();
+ javaPeer.reset();
rendererFrontend = nullptr;
}