diff --git a/include/osg/Referenced b/include/osg/Referenced index 782b9347e..e95b27037 100644 --- a/include/osg/Referenced +++ b/include/osg/Referenced @@ -31,6 +31,13 @@ namespace osg { class DeleteHandler; class Observer; +/** template class to help enforce static initialization order. */ +template +struct depends_on +{ + depends_on() { M(); } +}; + /** Base class from providing referencing counted objects.*/ class OSG_EXPORT Referenced { diff --git a/src/osgUtil/RenderBin.cpp b/src/osgUtil/RenderBin.cpp index e63d2763a..1ea40e8eb 100644 --- a/src/osgUtil/RenderBin.cpp +++ b/src/osgUtil/RenderBin.cpp @@ -26,8 +26,8 @@ using namespace osg; using namespace osgUtil; - -class RenderBinPrototypeList : public osg::Referenced, public std::map< std::string, osg::ref_ptr > +class RenderBinPrototypeList : osg::depends_on, + public osg::Referenced, public std::map< std::string, osg::ref_ptr > { public: RenderBinPrototypeList() {}