On Fri, 2006-08-04 at 12:42 -0600, Chris Hanson wrote:
> Robert, does OSG have a lot of singleton-like (but not actual singleton) 
> non-local 
> static objects? I wasn't aware of any before this, but I'm sure there must be 
> some. I'm 
> trying to imagine how I would search for them, other than just trawling all 
> the code.

Look for any objects with extern linkage in header files.

Look for any multiple objects with static linkage in source files. If
there is any interaction between those objects then their ctor order
must be defined. A simple (but fragile) way to do this is by ordering
the definitions in the order of dependency for objects in namespace
scope, e.g.

static A a;
static B b; // B depends on A
static C c; // C depends on B

If the dependencies ever change then the definition order in the source
code must change to match. That's what makes it fragile.

Regards,
Marcus

-- 
Mark Barnes
COLLADA Project Lead, tel:+1.650.655.7342
Sony Computer Entertainment America
http://research.scea.com

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to