///////////////////////////////////////////////////////////////////////////////
// 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)
{
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()
}
_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
{
public:
- SGTerraSync(SGPropertyNode_ptr root);
+ SGTerraSync();
virtual ~SGTerraSync();
virtual void init();
+ virtual void shutdown();
virtual void reinit();
virtual void bind();
virtual void unbind();
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