Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mbgl/style/layer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ std::unique_ptr<Layer> Layer::Impl::copy(const std::string& id_,
}

void Layer::Impl::setObserver(LayerObserver* observer_) {
observer = observer_;
observer = observer_ ? observer_ : &nullObserver;
}

} // namespace style
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/style/source_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void Source::Impl::dumpDebugLogs() const {
}

void Source::Impl::setObserver(SourceObserver* observer_) {
observer = observer_;
observer = observer_ ? observer_ : &nullObserver;
}

} // namespace style
Expand Down
2 changes: 2 additions & 0 deletions src/mbgl/style/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ std::unique_ptr<Source> Style::removeSource(const std::string& id) {
});

auto source = std::move(*it);
source->baseImpl->setObserver(nullptr);
sources.erase(it);
updateBatch.sourceIDs.erase(id);

Expand Down Expand Up @@ -264,6 +265,7 @@ std::unique_ptr<Layer> Style::removeLayer(const std::string& id) {
customLayer->impl->deinitialize();
}

layer->baseImpl->setObserver(nullptr);
layers.erase(it);
removeRenderLayer(id);
return layer;
Expand Down