forked from organicmaps/organicmaps
Clear overlay tree on context destruction.
This commit is contained in:
parent
131a3e3218
commit
a1bbe2b49c
3 changed files with 12 additions and 1 deletions
|
@ -87,6 +87,15 @@ OverlayTree::OverlayTree()
|
|||
m_handles[i].reserve(kAverageHandlesCount[i]);
|
||||
}
|
||||
|
||||
void OverlayTree::Clear()
|
||||
{
|
||||
m_frameCounter = kInvalidFrame;
|
||||
TBase::Clear();
|
||||
m_handlesCache.clear();
|
||||
for (auto & handles : m_handles)
|
||||
handles.clear();
|
||||
}
|
||||
|
||||
bool OverlayTree::Frame()
|
||||
{
|
||||
if (IsNeedUpdate())
|
||||
|
@ -107,7 +116,7 @@ bool OverlayTree::IsNeedUpdate() const
|
|||
void OverlayTree::StartOverlayPlacing(ScreenBase const & screen)
|
||||
{
|
||||
ASSERT(IsNeedUpdate(), ());
|
||||
Clear();
|
||||
TBase::Clear();
|
||||
m_handlesCache.clear();
|
||||
m_traits.m_modelView = screen;
|
||||
m_displacementInfo.clear();
|
||||
|
|
|
@ -48,6 +48,7 @@ public:
|
|||
|
||||
OverlayTree();
|
||||
|
||||
void Clear();
|
||||
bool Frame();
|
||||
bool IsNeedUpdate() const;
|
||||
|
||||
|
|
|
@ -1668,6 +1668,7 @@ void FrontendRenderer::OnContextDestroy()
|
|||
|
||||
m_selectObjectMessage.reset();
|
||||
m_overlayTree->SetSelectedFeature(FeatureID());
|
||||
m_overlayTree->Clear();
|
||||
|
||||
m_userMarkRenderGroups.clear();
|
||||
m_guiRenderer.reset();
|
||||
|
|
Loading…
Add table
Reference in a new issue