Hello,
I use win32gdk version 3.10/2
I have a class A which has a TGraph as a member. In A, a TF1 object is created and then attached it to the TGraph member using TGraph::GetListOfFunctions()->Add(). I have two instances of A:
pA is a pointer to the original
pSave = (A*)pA->Clone() is a pointer to a copy.
If I delete pA, pSave is still intact - as it should be. However, when I create a new instance of A, in particular, when the new TF1 is created, the TF1 attached to the TGraph member of pSave gets deleted! This makes no sense to me at all. I’ve attached simple a VC++6.0 project that demonstrates the problem.
Any help here greatly appreciated. Thanks!
Ed
example.zip (3.47 KB)