@@ -1387,11 +1387,11 @@ class coReadFileCallback : public osgDB::Registry::ReadFileCallback
13871387public:
13881388 virtual osgDB::ReaderWriter::ReadResult readNode (const std::string &fileName, const osgDB::ReaderWriter::Options *options)
13891389 {
1390- std::cout << " before readNode" << std::endl;
1390+ // std::cout << "before readNode" << std::endl;
13911391 // note when calling the Registry to do the read you have to call readNodeImplementation NOT readNode, as this will
13921392 // cause on infinite recusive loop.
13931393 osgDB::ReaderWriter::ReadResult result = osgDB::Registry::instance ()->readNodeImplementation (fileName, options);
1394- std::cout << " after readNode" << std::endl;
1394+ // std::cout << "after readNode" << std::endl;
13951395 if (result.getNode ())
13961396 {
13971397 if (result.getNode ()->getName ().length () == 0 )
@@ -1402,7 +1402,7 @@ class coReadFileCallback : public osgDB::Registry::ReadFileCallback
14021402 return result;
14031403 }
14041404};
1405- coReadFileCallback rfcb;
1405+ osg::ref_ptr< coReadFileCallback> rfcb;
14061406
14071407
14081408coVRFileManager::coVRFileManager ()
@@ -1467,8 +1467,8 @@ coVRFileManager::coVRFileManager()
14671467
14681468 osgDB::Registry::instance ()->addFileExtensionAlias (" gml" , " citygml" );
14691469 osgDB::Registry::instance ()->addFileExtensionAlias (" 3mxb" , " 3mx" );
1470-
1471- osgDB::Registry::instance ()->setReadFileCallback (& rfcb);
1470+ rfcb = new coReadFileCallback;
1471+ osgDB::Registry::instance ()->setReadFileCallback (rfcb);
14721472 updateSupportedFormats ();
14731473 options = new osgDB::ReaderWriter::Options;
14741474 options->setOptionString (coCoviseConfig::getEntry (" options" , " COVER.File" ));
0 commit comments