forked from organicmaps/organicmaps
should delete DrawerYG on OpenGL thread as there could be OpenGL calls.
This commit is contained in:
parent
06c5e96697
commit
6812b25242
2 changed files with 9 additions and 4 deletions
|
@ -25,6 +25,7 @@ TileRenderer::TileRenderer(
|
|||
double visualScale,
|
||||
yg::gl::PacketsQueue ** packetsQueues
|
||||
) : m_queue(executorsCount),
|
||||
m_executorsCount(executorsCount),
|
||||
m_tileCache(maxTilesCount - executorsCount - 1),
|
||||
m_renderFn(renderFn),
|
||||
m_skinName(skinName),
|
||||
|
@ -42,7 +43,7 @@ TileRenderer::TileRenderer(
|
|||
int tileWidth = m_resourceManager->params().m_renderTargetTexturesParams.m_texWidth;
|
||||
int tileHeight = m_resourceManager->params().m_renderTargetTexturesParams.m_texHeight;
|
||||
|
||||
for (unsigned i = 0; i < m_queue.ExecutorsCount(); ++i)
|
||||
for (unsigned i = 0; i < m_executorsCount; ++i)
|
||||
{
|
||||
DrawerYG::params_t params;
|
||||
|
||||
|
@ -81,7 +82,12 @@ TileRenderer::TileRenderer(
|
|||
TileRenderer::~TileRenderer()
|
||||
{
|
||||
m_isExiting = true;
|
||||
|
||||
m_queue.Cancel();
|
||||
|
||||
for (size_t i = 0; i < m_executorsCount; ++i)
|
||||
if (m_threadData[i].m_drawer)
|
||||
delete m_threadData[i].m_drawer;
|
||||
}
|
||||
|
||||
void TileRenderer::InitializeThreadGL(core::CommandsQueue::Environment const & env)
|
||||
|
@ -102,9 +108,6 @@ void TileRenderer::FinalizeThreadGL(core::CommandsQueue::Environment const & env
|
|||
{
|
||||
ThreadData & threadData = m_threadData[env.threadNum()];
|
||||
|
||||
|
||||
if (threadData.m_drawer != 0)
|
||||
delete threadData.m_drawer;
|
||||
if (threadData.m_renderContext)
|
||||
threadData.m_renderContext->endThreadDrawing();
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ protected:
|
|||
|
||||
core::CommandsQueue m_queue;
|
||||
|
||||
size_t m_executorsCount;
|
||||
|
||||
shared_ptr<yg::ResourceManager> m_resourceManager;
|
||||
|
||||
struct ThreadData
|
||||
|
|
Loading…
Add table
Reference in a new issue