forked from organicmaps/organicmaps
fixed memleak. closes #470
This commit is contained in:
parent
a7a30e69d7
commit
44f855abba
4 changed files with 17 additions and 5 deletions
|
@ -167,6 +167,7 @@ template <typename TElem>
|
|||
class ResourcePool
|
||||
{
|
||||
public:
|
||||
virtual ~ResourcePool(){}
|
||||
virtual TElem const Reserve() = 0;
|
||||
virtual void Free(TElem const & elem) = 0;
|
||||
virtual size_t Size() const = 0;
|
||||
|
|
|
@ -180,7 +180,7 @@ void Framework::SetMaxWorldRect()
|
|||
|
||||
bool Framework::NeedRedraw() const
|
||||
{
|
||||
return m_renderPolicy->NeedRedraw();
|
||||
return m_renderPolicy && m_renderPolicy->NeedRedraw();
|
||||
}
|
||||
|
||||
void Framework::SetNeedRedraw(bool flag)
|
||||
|
|
|
@ -57,6 +57,7 @@ void RenderQueue::initializeGL(shared_ptr<yg::gl::RenderContext> const & primary
|
|||
RenderQueue::~RenderQueue()
|
||||
{
|
||||
m_renderQueueThread.Cancel();
|
||||
delete m_routine;
|
||||
}
|
||||
|
||||
void RenderQueue::AddCommand(RenderQueueRoutine::render_fn_t const & fn, ScreenBase const & frameScreen)
|
||||
|
|
|
@ -42,7 +42,14 @@ namespace yg
|
|||
}
|
||||
|
||||
GeometryBatcher::~GeometryBatcher()
|
||||
{}
|
||||
{
|
||||
for (size_t i = 0; i < m_pipelines.size(); ++i)
|
||||
{
|
||||
discardPipeline(i);
|
||||
freeStorage(i);
|
||||
freeTexture(i);
|
||||
}
|
||||
}
|
||||
|
||||
void GeometryBatcher::reset(int pipelineID)
|
||||
{
|
||||
|
@ -361,10 +368,13 @@ namespace yg
|
|||
{
|
||||
GeometryPipeline & pipeline = m_pipelines[pipelineID];
|
||||
|
||||
shared_ptr<DiscardStorage> command(new DiscardStorage());
|
||||
command->m_storage = pipeline.m_storage;
|
||||
if (pipeline.m_hasStorage)
|
||||
{
|
||||
shared_ptr<DiscardStorage> command(new DiscardStorage());
|
||||
command->m_storage = pipeline.m_storage;
|
||||
|
||||
processCommand(command);
|
||||
processCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
void GeometryBatcher::flushPipeline(shared_ptr<SkinPage> const & skinPage,
|
||||
|
|
Loading…
Add table
Reference in a new issue