Introduced usage of OSG_INIT_SINGLETON_PROXY into DatabasePager::prototype() and Registry::instance(), removing the InitRegistry proxy object in src/osgViewer/ViewerBase.cpp.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15147 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
parent
de4a430931
commit
27962a73ee
@ -1236,6 +1236,8 @@ osg::ref_ptr<DatabasePager>& DatabasePager::prototype()
|
||||
return s_DatabasePager;
|
||||
}
|
||||
|
||||
OSG_INIT_SINGLETON_PROXY(ProxyInitDatabasePager, DatabasePager::prototype())
|
||||
|
||||
DatabasePager* DatabasePager::create()
|
||||
{
|
||||
return DatabasePager::prototype().valid() ?
|
||||
|
@ -214,6 +214,8 @@ Registry* Registry::instance(bool erase)
|
||||
return s_registry.get(); // will return NULL on erase
|
||||
}
|
||||
|
||||
OSG_INIT_SINGLETON_PROXY(ProxyInitRegistry, Registry::instance())
|
||||
|
||||
|
||||
// definition of the Registry
|
||||
Registry::Registry()
|
||||
|
@ -40,23 +40,6 @@ static osg::ApplicationUsageProxy ViewerBase_e5(osg::ApplicationUsage::ENVIRONME
|
||||
|
||||
using namespace osgViewer;
|
||||
|
||||
|
||||
struct InitRegistry
|
||||
{
|
||||
InitRegistry()
|
||||
{
|
||||
osgDB::Registry::instance();
|
||||
}
|
||||
|
||||
~InitRegistry()
|
||||
{
|
||||
osgDB::DatabasePager::prototype() = 0;
|
||||
osgDB::Registry::instance(true);
|
||||
}
|
||||
};
|
||||
|
||||
static InitRegistry s_InitRegistry;
|
||||
|
||||
ViewerBase::ViewerBase():
|
||||
osg::Object(true)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user