Revision: 6394
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6394&view=rev
Author:   natepak
Date:     2008-05-02 07:32:17 -0700 (Fri, 02 May 2008)

Log Message:
-----------
Fix to gzthrow

Modified Paths:
--------------
    code/gazebo/trunk/server/GazeboError.hh
    code/gazebo/trunk/server/Global.hh
    code/gazebo/trunk/server/World.cc
    code/gazebo/trunk/server/physics/ode/ODEPhysics.cc

Modified: code/gazebo/trunk/server/GazeboError.hh
===================================================================
--- code/gazebo/trunk/server/GazeboError.hh     2008-05-02 01:18:33 UTC (rev 
6393)
+++ code/gazebo/trunk/server/GazeboError.hh     2008-05-02 14:32:17 UTC (rev 
6394)
@@ -38,10 +38,8 @@
   /// \brief Gazebo error class
   /// \{
 
-  //TODO: global variable, static in the class would be better, if only the 
linker didn't oppose to it ...
-  static std::ostringstream throwStream;
   /// Throw an error
-  #define gzthrow(msg) {throwStream << "Exception: " << msg << std::endl << 
std::flush; throw gazebo::GazeboError(__FILE__,__LINE__,throwStream.str()); }
+  #define gzthrow(msg) {std::ostringstream throwStream; throwStream << 
"Exception: " << msg << std::endl << std::flush; throw 
gazebo::GazeboError(__FILE__,__LINE__,throwStream.str()); }
 
   
   /// \brief Class to handle errors

Modified: code/gazebo/trunk/server/Global.hh
===================================================================
--- code/gazebo/trunk/server/Global.hh  2008-05-02 01:18:33 UTC (rev 6393)
+++ code/gazebo/trunk/server/Global.hh  2008-05-02 14:32:17 UTC (rev 6394)
@@ -88,7 +88,7 @@
 
 #define ROUND(x) ( (int)( floor((x)+0.5) ) )
 
-#define GZ_DELETE(p){ if(p) { delete (p);  (p)=NULL; } }
+#define GZ_DELETE(p) { if(p) { delete (p);  (p)=NULL; } }
 
 namespace gazebo
 {

Modified: code/gazebo/trunk/server/World.cc
===================================================================
--- code/gazebo/trunk/server/World.cc   2008-05-02 01:18:33 UTC (rev 6393)
+++ code/gazebo/trunk/server/World.cc   2008-05-02 14:32:17 UTC (rev 6394)
@@ -55,6 +55,9 @@
   this->showJoints = false;
   this->wireframe = false;
   this->showPhysics = false;
+  this->physicsEngine = NULL;
+  this->server = NULL;
+  this->simIface = NULL;
 
 }
 

Modified: code/gazebo/trunk/server/physics/ode/ODEPhysics.cc
===================================================================
--- code/gazebo/trunk/server/physics/ode/ODEPhysics.cc  2008-05-02 01:18:33 UTC 
(rev 6393)
+++ code/gazebo/trunk/server/physics/ode/ODEPhysics.cc  2008-05-02 14:32:17 UTC 
(rev 6394)
@@ -78,9 +78,12 @@
 // Destructor
 ODEPhysics::~ODEPhysics()
 {
-  dSpaceDestroy(this->spaceId);
-  dWorldDestroy(this->worldId);
+  if (this->spaceId)
+    dSpaceDestroy(this->spaceId);
 
+  if (this->worldId)
+    dWorldDestroy(this->worldId);
+
   this->spaceId = NULL;
   this->worldId = NULL;
 }


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

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to