Skip to content

Automatic variable not updated #21534

@dpiparo

Description

@dpiparo

Check duplicate issues.

  • Checked for duplicates

Description

I am bringing JIRA item ROOT-10381 to the GitHub tracker since it seems relevant for the ROOT7 discussions, in particular the one about memory management (@hageboeck )

From https://root-forum.cern.ch/t/invalid-pointer-to-histograms-created-via-ttree-draw/36565 :

root [1] n->Draw("m01>>h1(100,2.8,3.4","");
root [2] h1->Draw()
root [3] n->Draw("m01>>h1(100,2.8,3.3","");
root [4] h1->Draw()

The last line crashes, because gDirectory's h1 got replaced but the variable doesn't realize that.

Reproducer

see above

ROOT version

all 6.* series

Installation method

all

Operating system

all

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions