Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-4489

Memory leak when TTree::BuildIndex is called multiple times

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: < v5-28-00, 5.34/00, 6.00.00
    • Fix Version/s: None
    • Component/s: I/O
    • Labels:
      None
    • Environment:

      All

      Description

      Hi ROOT folk,

      The documentation for TTree::BuildIndex states:
      &quot;A TTreeIndex object pointed by fTreeIndex is created. This object will be automatically deleted by the TTree destructor. See also comments in TTree::SetTreeIndex().&quot;

      So, TTree owns the index created with BuildIndex.

      However, if I call BuildIndex on a tree that already has an index built, I notice (from inspecting the code, no example script) that the old fTreeIndex index never gets deleted.

      In an ideal world, BuildIndex would check whether any updates to the tree had been performed, so you'd have:

      tree.BuildIndex("major", "minor");
      tree.BuildIndex("major", "minor"); // no-op

      But certainly BuildIndex should at least delete the old index before creating a new one.

      Thanks,
      Clayton

        Attachments

          Activity

            People

            Assignee:
            dpiparo Danilo Piparo
            Reporter:
            claytondavis Clayton Davis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: