Streamers and pointers to data members

From: Philip Rodrigues <p.rodrigues1_at_physics.ox.ac.uk>
Date: Wed, 26 Nov 2008 14:13:49 +0000


Hi roottalk,
I have a class with a data member which is a pointer to a TH2F. I can successfully stream it to disk, but when I read it back, I get a crash. The crash goes away if I set the TH2F pointer to zero in the default constructor. (The attached file contains a minimal example - run the "testrun.C" macro).

So my question is, do I always need to set pointers to zero in default constructors, or have I run into a bug? I couldn't see any mention of this in the documentation.

Thanks,
Philip

Received on Wed Nov 26 2008 - 15:13:58 CET

This archive was generated by hypermail 2.2.0 : Wed Nov 26 2008 - 17:50:02 CET