Sorry for bouncing this, but I'm getting some crashes which might be vaguely related to this (in TextureChunk's destructor).

How are FCPtr's references handled when stored in Fields in general?

/Marcus

Marcus Lindblom wrote:
Hi all,

I'm a bit bewildered by the behaviour of shallowcopy(), as it does not seem to update reference counts of fields holding field containers.

More specifically, I'm doing something like this: (in order to preserve filter & wrap fields I figured I'd make a copy of the field).

TextureChunkPtr tc = [node->core->material->chunk];
TextureChunkPtr tc2 = TextureChunkPtr::dcast(tc->shallowCopy());
tc2->setImage(newImage); // subrefs (ok) & dellocates (!?!)
// add as new texture to material
material->addchunk(tc2, tc->getslot() + 1);

I suppose I could inc the reference count for all the fcptr-fields when doing such copies... if that is the right way to do stuff. Just feels like too much error-prone user-work here.

Mayhap it's just shallowCopy() I shouldn't use, but something else?

Best regards,
/Marcus


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to