[android] fix ownership of style layer after delete

This commit is contained in:
Ivo van Dongen
2017-02-28 02:45:13 +02:00
committed by Ivo van Dongen
parent f0de56cffa
commit 609cdb0fd7
19 changed files with 185 additions and 19 deletions

View File

@@ -9,14 +9,27 @@
namespace mbgl {
namespace android {
/**
* Creates an owning peer object (for layers not attached to the map) from the JVM side
*/
RasterLayer::RasterLayer(jni::JNIEnv& env, jni::String layerId, jni::String sourceId)
: Layer(env, std::make_unique<mbgl::style::RasterLayer>(jni::Make<std::string>(env, layerId), jni::Make<std::string>(env, sourceId))) {
}
/**
* Creates a non-owning peer object (for layers currently attached to the map)
*/
RasterLayer::RasterLayer(mbgl::Map& map, mbgl::style::RasterLayer& coreLayer)
: Layer(map, coreLayer) {
}
/**
* Creates an owning peer object (for layers not attached to the map)
*/
RasterLayer::RasterLayer(mbgl::Map& map, std::unique_ptr<mbgl::style::RasterLayer> coreLayer)
: Layer(map, std::move(coreLayer)) {
}
RasterLayer::~RasterLayer() = default;
// Property getters