[Jderobot-admin] jderobot-r1205 - trunk/src/stable/components/openniServer

rocapal en jderobot.org rocapal en jderobot.org
Mie Mar 19 13:19:52 CET 2014


Author: rocapal
Date: 2014-03-19 13:19:51 +0100 (Wed, 19 Mar 2014)
New Revision: 1205

Modified:
   trunk/src/stable/components/openniServer/openniServer.cpp
Log:
#195 unbindAll when the app finished



Modified: trunk/src/stable/components/openniServer/openniServer.cpp
===================================================================
--- trunk/src/stable/components/openniServer/openniServer.cpp	2014-03-19 12:18:36 UTC (rev 1204)
+++ trunk/src/stable/components/openniServer/openniServer.cpp	2014-03-19 12:19:51 UTC (rev 1205)
@@ -470,6 +470,8 @@
 	//fill imageDescription
 	imageDescription->width = colorVideoMode.getResolutionX();
 	imageDescription->height = colorVideoMode.getResolutionY();
+
+
 	int playerdetection = prop->getPropertyAsIntWithDefault(prefix+"PlayerDetection",0);
 
 	#ifndef WITH_NITE2
@@ -743,6 +745,7 @@
 	jderobot::Logger::getInstance()->info( "Starting thread for camera: " +  cameraDescription->name );
 	replyTask = new ReplyTask(this, imageDescription->width, imageDescription->height,fps, playerdetection);
 
+
 	this->control=replyTask->start();//my own thread
 	}
 
@@ -1158,7 +1161,6 @@
 openniServer::CameraDEPTH *camDEPTH;
 openniServer::pointCloudI *pc1;
 jderobot::ns* namingService = NULL;
-std::vector<std::string> bindNamingService;
 
 void exitApplication(int s){
 
@@ -1177,8 +1179,7 @@
 	// NamingService
 	if (namingService != NULL)
 	{
-		for(std::vector<std::string>::iterator it = bindNamingService.begin(); it!=bindNamingService.end(); it++)
-				namingService->unbind(*it);
+		namingService->unbindAll();
 
 		delete(namingService);
 	}
@@ -1355,12 +1356,11 @@
 		jderobot::Logger::getInstance()->info("              -------- openniServer: Component: CameraRGB created successfully(" + Endpoints + "@" + cameraName );
 
 
-		if (nsActive)
-		{
+		if (namingService)
 			namingService->bind(cameraName, Endpoints, camRGB->ice_staticId());
-			bindNamingService.push_back(cameraName);
-		}
 
+
+
 	}
 
 	if (cameraD){
@@ -1376,11 +1376,9 @@
 		//test camera ok
 		jderobot::Logger::getInstance()->info("              -------- openniServer: Component: CameraDEPTH created successfully(" + Endpoints + "@" + cameraName );
 
-		if (nsActive)
-		{
+		if (namingService)
 			namingService->bind(cameraName, Endpoints, camDEPTH->ice_staticId());
-			bindNamingService.push_back(cameraName);
-		}
+
 	}
 
 	if (pointCloud){



More information about the Jderobot-admin mailing list