Introduced a destruct method to help clean up the Registry.
This commit is contained in:
@@ -438,6 +438,9 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
void destruct();
|
||||
|
||||
// forward declare helper classes
|
||||
struct ReadObjectFunctor;
|
||||
struct ReadImageFunctor;
|
||||
|
||||
@@ -121,7 +121,8 @@ Registry* Registry::instance(bool erase)
|
||||
{
|
||||
static ref_ptr<Registry> s_registry = new Registry;
|
||||
if (erase)
|
||||
{
|
||||
{
|
||||
s_registry->destruct();
|
||||
s_registry = 0;
|
||||
}
|
||||
return s_registry.get(); // will return NULL on erase
|
||||
@@ -241,6 +242,11 @@ Registry::Registry()
|
||||
|
||||
|
||||
Registry::~Registry()
|
||||
{
|
||||
destruct();
|
||||
}
|
||||
|
||||
void Registry::destruct()
|
||||
{
|
||||
// switch off the pager and its associated thread before we clean up
|
||||
// rest of the Registry.
|
||||
|
||||
Reference in New Issue
Block a user