mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:00:04 +00:00
Destroy layer after deinitialize call is complete
MapLibre seems to relatively consistently not destroy layers the first time layers are removed and re-added
This commit is contained in:
parent
76cd000650
commit
daf1ff39e5
1 changed files with 17 additions and 3 deletions
|
|
@ -31,17 +31,31 @@ LayerWrapper& LayerWrapper::operator=(LayerWrapper&&) noexcept = default;
|
|||
|
||||
void LayerWrapper::initialize()
|
||||
{
|
||||
p->layer_->Initialize();
|
||||
auto& layer = p->layer_;
|
||||
if (layer != nullptr)
|
||||
{
|
||||
layer->Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
void LayerWrapper::render(const QMapLibre::CustomLayerRenderParameters& params)
|
||||
{
|
||||
p->layer_->Render(params);
|
||||
auto& layer = p->layer_;
|
||||
if (layer != nullptr)
|
||||
{
|
||||
layer->Render(params);
|
||||
}
|
||||
}
|
||||
|
||||
void LayerWrapper::deinitialize()
|
||||
{
|
||||
p->layer_->Deinitialize();
|
||||
// Ensure layers are not retained after call to deinitialize
|
||||
auto& layer = p->layer_;
|
||||
if (layer != nullptr)
|
||||
{
|
||||
layer->Deinitialize();
|
||||
layer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace map
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue