Page MenuHomePhabricator

I think there is a Memory leak
Closed, ResolvedPublic

Description

I think there is a Memory leak

void mitk::VtkPropRenderer::PrepareMapperQueue()
{

//
   ................code...............................

//

// remove all text properties before mappers will add new ones
m_TextRenderer->RemoveAllViewProps();    //can it release mem?
m_TextCollection.clear();       /// here may be mem leak??

//

................code...............................

//

and how to report bug

Event Timeline

m_TextRenderer->RemoveAllViewProps(); does not release memory, but is also not the right place to do it. Not a leak in my opinion.

m_TextCollection.clear(); is a leak;

Could we instead of iterating the map just use vtkSmartPointers as items of the map? That would make the code much simpler.

Would be the much nicer solution, but I don't get it to work for me (just tried).
But actually I am not completely sure what happens here exactly.
I try to get one of the rendering guys to have a look at it next BSP.

Just seen that text is displayed in very strange positions anyway.
Will open a new bug for that.

Not a real leak:
Objects are removed from the rendering list here, but should not be deleted.
They are still held by the actors.