Objects with the same name

What are the rules governing the creation of objects with the same name in memory? Is it allowed or will it cause a memory error? In particular I’m thinking about dynamically created TF1s. Do I need to ensure that they all have a unique name?

Cheers,

Hugh

Hi,

Some of the objects (type) are being kept in list. The name must be unique within each of this list. And so in general you need to either use a unique name or make sure the object is remove from the list.
For example, canvases are kept in gROOT->GetListOfCanvases(),
function are kept in gROOT->GetListOfFunctions(),
histogram and TTree are kept in the directory that was current at the time of their creation, etc.

Cheers,
Philippe.

PS. To remove a function from the list do