Reset: Terrasync root can change, can be shutdown.
This commit is contained in:
@@ -755,11 +755,10 @@ void SGTerraSync::SvnThread::writeCompletedTilesPersistentCache() const
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SGTerraSync ////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
SGTerraSync::SGTerraSync(SGPropertyNode_ptr root) :
|
||||
SGTerraSync::SGTerraSync() :
|
||||
_svnThread(NULL),
|
||||
last_lat(NOWHERE),
|
||||
last_lon(NOWHERE),
|
||||
_terraRoot(root->getNode("/sim/terrasync",true)),
|
||||
_bound(false),
|
||||
_inited(false)
|
||||
{
|
||||
@@ -772,11 +771,16 @@ SGTerraSync::SGTerraSync(SGPropertyNode_ptr root) :
|
||||
|
||||
SGTerraSync::~SGTerraSync()
|
||||
{
|
||||
_tiedProperties.Untie();
|
||||
delete _svnThread;
|
||||
_svnThread = NULL;
|
||||
sglog().removeCallback(_log);
|
||||
delete _log;
|
||||
_tiedProperties.Untie();
|
||||
}
|
||||
|
||||
void SGTerraSync::setRoot(SGPropertyNode_ptr root)
|
||||
{
|
||||
_terraRoot = root->getNode("/sim/terrasync",true);
|
||||
}
|
||||
|
||||
void SGTerraSync::init()
|
||||
@@ -786,11 +790,18 @@ void SGTerraSync::init()
|
||||
}
|
||||
|
||||
_inited = true;
|
||||
|
||||
assert(_terraRoot);
|
||||
_terraRoot->setBoolValue("built-in-svn-available",svn_built_in_available);
|
||||
|
||||
reinit();
|
||||
}
|
||||
|
||||
void SGTerraSync::shutdown()
|
||||
{
|
||||
_svnThread->stop();
|
||||
}
|
||||
|
||||
void SGTerraSync::reinit()
|
||||
{
|
||||
// do not reinit when enabled and we're already up and running
|
||||
|
||||
@@ -40,10 +40,11 @@ class SGTerraSync : public SGSubsystem
|
||||
{
|
||||
public:
|
||||
|
||||
SGTerraSync(SGPropertyNode_ptr root);
|
||||
SGTerraSync();
|
||||
virtual ~SGTerraSync();
|
||||
|
||||
virtual void init();
|
||||
virtual void shutdown();
|
||||
virtual void reinit();
|
||||
virtual void bind();
|
||||
virtual void unbind();
|
||||
@@ -59,6 +60,8 @@ public:
|
||||
|
||||
bool scheduleTile(const SGBucket& bucket);
|
||||
|
||||
void setRoot(SGPropertyNode_ptr root);
|
||||
|
||||
/// retrive the associated log object, for displaying log
|
||||
/// output somewhere (a UI, presumably)
|
||||
BufferedLogCallback* log() const
|
||||
|
||||
Reference in New Issue
Block a user