[asterisk-scf-commits] asterisk-scf/integration/media_format_ulaw.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Sep 13 09:55:56 CDT 2010


branch "master" has been updated
       via  4413253a7ec783b83e697da5b41e6ca552c0f659 (commit)
      from  e76f518a9ba6196e2e704818487336773c1c6b8f (commit)

Summary of changes:
 src/MediaFormatULAW.cpp |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit 4413253a7ec783b83e697da5b41e6ca552c0f659
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Sep 13 12:02:16 2010 -0300

    Fix a bug where media_format_ulaw may or may not have been unregistered from the service locator during shutdown.

diff --git a/src/MediaFormatULAW.cpp b/src/MediaFormatULAW.cpp
index 2016d45..2422ed2 100644
--- a/src/MediaFormatULAW.cpp
+++ b/src/MediaFormatULAW.cpp
@@ -100,6 +100,15 @@ public:
 	void interruptCallback(int);
 
 private:
+	/**
+	 * A proxy to the service locator manager for the media format interface.
+	 */
+	ServiceManagementPrx mServiceManagement;
+
+	/**
+	 * A proxy to the service locator manager for the component interface.
+	 */
+	ServiceManagementPrx mComponentServiceManagement;
 };
 
 /**
@@ -196,33 +205,32 @@ int MediaFormatULAWApp::run(int argc, char* argv[])
 	management->addCompare(ServiceLocatorParamsCompareProxy->ice_getIdentity().name, ServiceLocatorParamsCompareProxy);
 
 	/* Boom! In we go as a service. */
-	ServiceManagementPrx service_management = ServiceManagementPrx::uncheckedCast(management->addService(MediaFormatServiceProxy, "media_format_ulaw"));
+	ServiceManagementPrx mServiceManagement = ServiceManagementPrx::uncheckedCast(management->addService(MediaFormatServiceProxy, "media_format_ulaw"));
 
 	/* One must provide a component service to manage us, if someone wants to */
-	ComponentServicePtr ComponentService = new ComponentServiceImpl(*this, service_management);
+	ComponentServicePtr ComponentService = new ComponentServiceImpl(*this, mServiceManagement);
 	ComponentServicePrx ComponentServiceProxy = ComponentServicePrx::uncheckedCast(adapter->addWithUUID(ComponentService));
 
 	/* Let's add the component service to the service locator first */
-	ServiceManagementPrx component_service_management = ServiceManagementPrx::uncheckedCast(management->addService(ComponentServiceProxy, "media_format_ulaw"));
+	ServiceManagementPrx mComponentServiceManagement = ServiceManagementPrx::uncheckedCast(management->addService(ComponentServiceProxy, "media_format_ulaw"));
 	ServiceLocatorParamsPtr genericparams = new ServiceLocatorParams();
 	genericparams->category = "Component/media_format_ulaw";
-	component_service_management->addLocatorParams(genericparams, "");
+	mComponentServiceManagement->addLocatorParams(genericparams, "");
 
 	/* Now we can add some parameters to help find the actual media format service. */
 	genericparams->category = "media_format";
-	service_management->addLocatorParams(genericparams, ServiceLocatorParamsCompareProxy->ice_getIdentity().name);
+	mServiceManagement->addLocatorParams(genericparams, ServiceLocatorParamsCompareProxy->ice_getIdentity().name);
 
 	/* Welp we are now in the service locator... they can find us! */
 	communicator()->waitForShutdown();
 
-	/* When all is said and done we have to leave the party */
-	component_service_management->unregister();
-	service_management->unregister();
-
 	return EXIT_SUCCESS;
 }
 
 void MediaFormatULAWApp::interruptCallback(int val)
 {
+	/* When all is said and done we have to leave the party */
+	mComponentServiceManagement->unregister();
+	mServiceManagement->unregister();
 	_exit(EXIT_SUCCESS);
 }

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/media_format_ulaw.git



More information about the asterisk-scf-commits mailing list