# Calling GetStreamerInfo() from a ctor in ROOT 5

Dear experts,

I have some classes which are derived from TObject and which have in their default
ctor these lines:

TClass* c = Class();
if ( c && c->GetStreamerInfo() == 0 ) {
c->IgnoreTObjectStreamer();
}

This worked fine in various ROOT 4 versions, but with ROOT 5.10.00 GetStreamerInfo()
calls the default constructor of my class, and this gives an endless loop.

Do I have to abandon constructs like this, or do I have to do this in a different way?

Thanks,
Matthias

Hi,

I think that instead of

Cheers,
Philippe.

Ps. In your code sample, the test should never be true since there should always be a TStreamerInfo (and in the case where there would be one, then c->IgnoreTObjectStreamer(); would be useless.

Hi Philippe,

your version seems to work. And I’ll think about your comment.

Thanks,
Matthias

[quote=“pcanal”]Hi,

I think that instead of

Cheers,
Philippe.

Ps. In your code sample, the test should never be true since there should always be a TStreamerInfo (and in the case where there would be one, then c->IgnoreTObjectStreamer(); would be useless.[/quote]