diff --git a/base/resource_pool.hpp b/base/resource_pool.hpp index 69edc011c1..47070be41c 100644 --- a/base/resource_pool.hpp +++ b/base/resource_pool.hpp @@ -167,6 +167,7 @@ template class ResourcePool { public: + virtual ~ResourcePool(){} virtual TElem const Reserve() = 0; virtual void Free(TElem const & elem) = 0; virtual size_t Size() const = 0; diff --git a/map/framework.cpp b/map/framework.cpp index 754e1ec98c..05c617f711 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -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) diff --git a/map/render_queue.cpp b/map/render_queue.cpp index 1a53131879..b184b89fb1 100644 --- a/map/render_queue.cpp +++ b/map/render_queue.cpp @@ -57,6 +57,7 @@ void RenderQueue::initializeGL(shared_ptr const & primary RenderQueue::~RenderQueue() { m_renderQueueThread.Cancel(); + delete m_routine; } void RenderQueue::AddCommand(RenderQueueRoutine::render_fn_t const & fn, ScreenBase const & frameScreen) diff --git a/yg/geometry_batcher.cpp b/yg/geometry_batcher.cpp index 1c2173e6e7..de1c0f55f2 100644 --- a/yg/geometry_batcher.cpp +++ b/yg/geometry_batcher.cpp @@ -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 command(new DiscardStorage()); - command->m_storage = pipeline.m_storage; + if (pipeline.m_hasStorage) + { + shared_ptr command(new DiscardStorage()); + command->m_storage = pipeline.m_storage; - processCommand(command); + processCommand(command); + } } void GeometryBatcher::flushPipeline(shared_ptr const & skinPage,