celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1654884 - in /celix/trunk/remote_services: remote_service_admin/private/src/import_registration_impl.c remote_service_admin_http/private/src/remote_service_admin_impl.c
Date Mon, 26 Jan 2015 20:19:27 GMT
Author: bpetri
Date: Mon Jan 26 20:19:27 2015
New Revision: 1654884

URL: http://svn.apache.org/r1654884
Log:

Add null check for destroyed registrationfactory


Modified:
    celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
    celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c

Modified: celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c?rev=1654884&r1=1654883&r2=1654884&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
(original)
+++ celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
Mon Jan 26 20:19:27 2015
@@ -98,6 +98,8 @@ celix_status_t importRegistrationFactory
 
 		serviceTracker_destroy((*registration_factory)->proxyFactoryTracker);
 		free(*registration_factory);
+
+		*registration_factory = NULL;
 	}
 
 

Modified: celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c?rev=1654884&r1=1654883&r2=1654884&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
(original)
+++ celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
Mon Jan 26 20:19:27 2015
@@ -223,23 +223,24 @@ celix_status_t remoteServiceAdmin_stop(r
 
     	import_registration_factory_pt importFactory = hashMapEntry_getValue(entry);
 
-        int i;
-        for (i = 0; i < arrayList_size(importFactory->registrations); i++)
-        {
-            import_registration_pt importRegistration = arrayList_get(importFactory->registrations,
i);
-
-			if (importFactory->trackedFactory != NULL)
-			{
-				importFactory->trackedFactory->unregisterProxyService(importFactory->trackedFactory->factory,
importRegistration->endpointDescription);
-			}
-        }
-
-        serviceTracker_close(importFactory->proxyFactoryTracker);
-        importRegistrationFactory_close(importFactory);
-
-        hashMapIterator_remove(iter);
-		importRegistrationFactory_destroy(&importFactory);
-
+        if (importFactory != NULL) {
+            int i;
+            for (i = 0; i < arrayList_size(importFactory->registrations); i++)
+            {
+                import_registration_pt importRegistration = arrayList_get(importFactory->registrations,
i);
+
+                if (importFactory->trackedFactory != NULL)
+                {
+                    importFactory->trackedFactory->unregisterProxyService(importFactory->trackedFactory->factory,
importRegistration->endpointDescription);
+                }
+            }
+
+            serviceTracker_close(importFactory->proxyFactoryTracker);
+            importRegistrationFactory_close(importFactory);
+
+            hashMapIterator_remove(iter);
+            importRegistrationFactory_destroy(&importFactory);
+            }
     }
     hashMapIterator_destroy(iter);
     celixThreadMutex_unlock(&admin->importedServicesLock);



Mime
View raw message