Clear overlay tree on context destruction.

This commit is contained in:
Daria Volvenkova 2017-05-29 16:12:06 +03:00
parent 131a3e3218
commit a1bbe2b49c
3 changed files with 12 additions and 1 deletions

View file

@ -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();

View file

@ -48,6 +48,7 @@ public:
OverlayTree();
void Clear();
bool Frame();
bool IsNeedUpdate() const;

View file

@ -1668,6 +1668,7 @@ void FrontendRenderer::OnContextDestroy()
m_selectObjectMessage.reset();
m_overlayTree->SetSelectedFeature(FeatureID());
m_overlayTree->Clear();
m_userMarkRenderGroups.clear();
m_guiRenderer.reset();