TGraph ownership

Hi ROOTers

This is a question about ownership.
Looking at the documentation, TGraph does not belong to any special ROOT container and they never get added automatically to the current directory. So I could say the TGraph object belongs to the user, right?
What is the status of the kMustCleanUp and kCanDelete bits for the creation of any TGraph obj?

Let’s assume I have

TGraph* mygr = new TGraph(n,x,y); 

What happens when I draw mygr into the current pad. Will that be automatically associated to the current pad? (aka the Pad owns the TGraph obj)

If I want to create a copy of this class, what happens to the copy? Would also copy the ownership properties?

If I create a clone with the next methods, who owns it?
TGraphErrors* halfGaus1 = new TGraphErrors(mygr);
TGraphErrors
halfGaus2 = mygr->Clone(“clone2”);
mygr->DrawClone(); //This one its own by the current pad, that I have clear.

Thxs for making this clear,

[quote]What happens when I draw mygr into the current pad. Will that be automatically associated to the current pad? (aka the Pad owns the TGraph obj)[/quote]No, it would not be owned by the pad unless you explicitly delegate ownership via the kCanDelete bit.

[quote]Would also copy the ownership properties?[/quote]No, the kCanDelete and kIsReferenced bits are reset.

Cheers,
Philippe.

Thanks a lot!