Revision: 7991
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7991&view=rev
Author:   hsujohnhsu
Date:     2009-07-11 21:16:15 +0000 (Sat, 11 Jul 2009)

Log Message:
-----------
update Factory destructor.

Modified Paths:
--------------
    code/gazebo/trunk/server/Factory.cc

Modified: code/gazebo/trunk/server/Factory.cc
===================================================================
--- code/gazebo/trunk/server/Factory.cc 2009-07-11 02:18:54 UTC (rev 7990)
+++ code/gazebo/trunk/server/Factory.cc 2009-07-11 21:16:15 UTC (rev 7991)
@@ -64,7 +64,13 @@
 // Destructor
 Factory::~Factory()
 {
-  delete this->factoryIface;
+  if (this->factoryIface)
+  {
+    this->factoryIface->Close();
+    this->factoryIface->Destroy();
+    delete this->factoryIface;
+    this->factoryIface = NULL;
+  }
 }
 
 
////////////////////////////////////////////////////////////////////////////////
@@ -104,12 +110,12 @@
   }
 
   // Attempt to delete a model by name, if the string is present
-  /*if (strcmp((const char*)this->factoryIface->data->deleteModel,"")!=0)
+  if (strcmp((const char*)this->factoryIface->data->deleteModel,"")!=0)
   {
     World::Instance()->DeleteEntity((const 
char*)this->factoryIface->data->deleteModel);
 
     strcpy((char*)this->factoryIface->data->deleteModel,"");
-  }*/
+  }
   this->factoryIface->Unlock();
 
 }


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

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to