log history memory usage add fix virtual dtor for Action subclasses to be deleted from memory

This commit is contained in:
2017-05-10 13:41:27 +01:00
parent eb8f93af91
commit 6f785c1944
6 changed files with 50 additions and 21 deletions

View File

@@ -157,6 +157,21 @@ public:
m_canvas->m_layers[m_layer_idx].m_rtt[i].unbindTexture();
}
}
virtual size_t memory() override
{
size_t mem = 0;
for (int i = 0; i < 6; i++)
{
glm::vec2 sz = m_box[i].zw() - m_box[i].xy();
mem += sz.x * sz.y * 4 + sizeof(*this);
}
return mem;
}
virtual ~ActionStroke()
{
LOG("ActionStroke destroyed: free %zu bytes", memory());
}
};
NS_END