TEveElement life cycle

I experience problems with TEve.

I create dynamically set of TEveElementList**pts containing lines (TEveLine*) and point (TEvePointSet*).
On each iteration I:

  1. remove previous object collection (TEveElementList) from the scene (m_XYZEventScene->RemoveElement(pts[i]) )
    2)add instead new ones ((m_XYZEventScene->AddElement(pts[i+1]) )
  2. later on (for sure after redrawing completed) i try to delete old sets. yet the memory isn’t fully freed.

When I call pts[i]->Desroy(), they are not actually deleted. if i delete them - crash.
If I try to delete also the children explicitly (both line[j]->Destroy() and pts[i]->DestroyElements() ), i get the error “TEveManager::TExceptionHandler::Handle: TEveGedEditor::ElementChanged not a TObject.”.

What is the proper way to recreate many TEve objects, and avoid leaks? (ROOT is still 32bit only on windows =(( )

ROOT Version: 5.34/30
Platform: Win
Compiler: Not Provided


Can you please put your code somewhere so i can give it a try. In principle it should be sufficient to call scene->DestroyElements() or use pts[i]->Destroy(). EVE uses reference counting and automatically deletes elements when ref count falls to zero (when parent is destroyed, it will do the same for its children, so destroying the parent should be sufficient).

If you set gDebug=1 you should see the auto destruct (and related) messages.


I believe i have found the reason to the problem.
When updating the scene I have performed synchronization via single shot of TTimer. Yet it seems to be not thread-safe.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.