[android] shutting down thread pool of the CustomGeometrySource when the source is destroyed
This commit is contained in:
committed by
Łukasz Paczos
parent
b500577bfa
commit
63d4ac05f2
@@ -109,7 +109,7 @@ namespace android {
|
||||
rendererFrontend = &frontend;
|
||||
}
|
||||
|
||||
void Source::removeFromMap(JNIEnv&, jni::Object<Source>, mbgl::Map& map) {
|
||||
bool Source::removeFromMap(JNIEnv&, jni::Object<Source>, mbgl::Map& map) {
|
||||
// Cannot remove if not attached yet
|
||||
if (ownedSource) {
|
||||
throw std::runtime_error("Cannot remove detached source");
|
||||
@@ -119,6 +119,11 @@ namespace android {
|
||||
ownedSource = map.getStyle().removeSource(source.getID());
|
||||
|
||||
// The source may not be removed if any layers still reference it
|
||||
return ownedSource != nullptr;
|
||||
}
|
||||
|
||||
void Source::releaseJavaPeer() {
|
||||
// We can't release the peer if the source was not removed from the map
|
||||
if (!ownedSource) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user