[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
*/
BackgroundLayer::BackgroundLayer(jni::JNIEnv& env, jni::String layerId)
: Layer(env, std::make_unique<mbgl::style::BackgroundLayer>(jni::Make<std::string>(env, layerId))) {
}
/**
* Creates a non-owning peer object (for layers currently attached to the map)
*/
BackgroundLayer::BackgroundLayer(mbgl::Map& map, mbgl::style::BackgroundLayer& coreLayer)
: Layer(map, coreLayer) {
}
/**
* Creates an owning peer object (for layers not attached to the map)
*/
BackgroundLayer::BackgroundLayer(mbgl::Map& map, std::unique_ptr<mbgl::style::BackgroundLayer> coreLayer)
: Layer(map, std::move(coreLayer)) {
}
BackgroundLayer::~BackgroundLayer() = default;
// Property getters