Revision: 8840
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8840&view=rev
Author:   natepak
Date:     2010-07-29 14:44:49 +0000 (Thu, 29 Jul 2010)

Log Message:
-----------
Fixed loading of world files

Modified Paths:
--------------
    code/gazebo/branches/wx/libgazebo/Server.cc
    code/gazebo/branches/wx/server/Simulator.cc
    code/gazebo/branches/wx/server/World.cc
    code/gazebo/branches/wx/server/rendering/Light.cc
    code/gazebo/branches/wx/server/rendering/OgreAdaptor.cc
    code/gazebo/branches/wx/server/rendering/RTShaderSystem.cc

Modified: code/gazebo/branches/wx/libgazebo/Server.cc
===================================================================
--- code/gazebo/branches/wx/libgazebo/Server.cc 2010-07-29 01:11:17 UTC (rev 
8839)
+++ code/gazebo/branches/wx/libgazebo/Server.cc 2010-07-29 14:44:49 UTC (rev 
8840)
@@ -61,24 +61,7 @@
 // Destroy a server
 Server::~Server()
 {
-  if (rmdir(this->filename.c_str()))
-  {
-    std::cerr << "Error deleting directory\n";
-    /*if (errno == EEXIST)
-    {
-      errStream << "directory [" <<  this->filename
-      <<  "] already exists (previous crash?)"
-      << "remove the directory and re-run gazebo";
-      throw(errStream.str());
-    }
-    else
-    {
-      errStream << "failed to create [" << this->filename << "] : ["
-      <<  strerror(errno) << "]";
-      throw(errStream.str());
-    }
-    */
-  }
+  this->Fini();
 }
 
 
////////////////////////////////////////////////////////////////////////////////
@@ -200,6 +183,7 @@
   {
     std::ostringstream stream;
     stream << "error deleting pid file: " << strerror(errno);
+    std::cerr << stream.str();
     throw(stream.str());
   }
 

Modified: code/gazebo/branches/wx/server/Simulator.cc
===================================================================
--- code/gazebo/branches/wx/server/Simulator.cc 2010-07-29 01:11:17 UTC (rev 
8839)
+++ code/gazebo/branches/wx/server/Simulator.cc 2010-07-29 14:44:49 UTC (rev 
8840)
@@ -711,7 +711,6 @@
   Time lastTime = this->GetRealTime();
   struct timespec req, rem;
 
-
   while (!this->physicsQuit)
   {
     //DiagnosticTimer timer("PhysicsLoop Timer ");

Modified: code/gazebo/branches/wx/server/World.cc
===================================================================
--- code/gazebo/branches/wx/server/World.cc     2010-07-29 01:11:17 UTC (rev 
8839)
+++ code/gazebo/branches/wx/server/World.cc     2010-07-29 14:44:49 UTC (rev 
8840)
@@ -103,6 +103,7 @@
       (*iter) = NULL;
     }
   }
+  this->models.clear();
 
   if (this->physicsEngine)
   {
@@ -117,6 +118,14 @@
       delete this->simIface;
       this->simIface = NULL;
     }
+
+    if (this->graphics)
+      delete this->graphics;
+    this->graphics = NULL;
+
+    if (this->factory)
+      delete this->factory;
+    this->factory = NULL;
   }
   catch (std::string e)
   {
@@ -129,12 +138,7 @@
     this->server =NULL;
   }
 
-  if (this->factory)
-  {
-    delete this->factory;
-    this->factory = NULL;
-  }
-
+  /*
   if (this->saveStateTimeoutP)
     delete this->saveStateTimeoutP;
   this->saveStateTimeoutP = NULL;
@@ -146,6 +150,7 @@
   if (this->threadsP)
     delete this->threadsP;
   this->threadsP = NULL;
+  */
 
 #ifdef USE_THREADPOOL
   if (this->threadPool)

Modified: code/gazebo/branches/wx/server/rendering/Light.cc
===================================================================
--- code/gazebo/branches/wx/server/rendering/Light.cc   2010-07-29 01:11:17 UTC 
(rev 8839)
+++ code/gazebo/branches/wx/server/rendering/Light.cc   2010-07-29 14:44:49 UTC 
(rev 8840)
@@ -71,6 +71,9 @@
 /// Destructor
 Light::~Light()
 {
+  if (this->light)
+    OgreAdaptor::Instance()->sceneMgr->destroyLight(this->GetName());
+
   delete this->line;
   delete this->visual;
 

Modified: code/gazebo/branches/wx/server/rendering/OgreAdaptor.cc
===================================================================
--- code/gazebo/branches/wx/server/rendering/OgreAdaptor.cc     2010-07-29 
01:11:17 UTC (rev 8839)
+++ code/gazebo/branches/wx/server/rendering/OgreAdaptor.cc     2010-07-29 
14:44:49 UTC (rev 8840)
@@ -106,6 +106,7 @@
   if (this->frameListener)
     delete this->frameListener;
   this->frameListener = NULL;
+  this->Fini();
 }
 
 
////////////////////////////////////////////////////////////////////////////////

Modified: code/gazebo/branches/wx/server/rendering/RTShaderSystem.cc
===================================================================
--- code/gazebo/branches/wx/server/rendering/RTShaderSystem.cc  2010-07-29 
01:11:17 UTC (rev 8839)
+++ code/gazebo/branches/wx/server/rendering/RTShaderSystem.cc  2010-07-29 
14:44:49 UTC (rev 8840)
@@ -49,6 +49,7 @@
 /// Destructor
 RTShaderSystem::~RTShaderSystem()
 {
+  this->Fini();
 }
 
 
////////////////////////////////////////////////////////////////////////////////


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to