incubator-celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1528037 - /incubator/celix/trunk/framework/private/src/service_tracker.c
Date Tue, 01 Oct 2013 10:29:14 GMT
Author: abroekhuis
Date: Tue Oct  1 10:29:14 2013
New Revision: 1528037

URL: http://svn.apache.org/r1528037
Log:
CELIX-25: Added checks to see if a customiser function is NULL. Where needed the default path
is used.

Modified:
    incubator/celix/trunk/framework/private/src/service_tracker.c

Modified: incubator/celix/trunk/framework/private/src/service_tracker.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_tracker.c?rev=1528037&r1=1528036&r2=1528037&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_tracker.c (original)
+++ incubator/celix/trunk/framework/private/src/service_tracker.c Tue Oct  1 10:29:14 2013
@@ -267,7 +267,9 @@ celix_status_t serviceTracker_track(serv
 				serviceTrackerCustomizer_getHandle(tracker->customizer, &handle);
 				serviceTrackerCustomizer_getAddedFunction(tracker->customizer, &function);
 
-				function(handle, reference, service);
+				if (function != NULL) {
+					function(handle, reference, service);
+				}
 			}
 		}
 
@@ -279,7 +281,9 @@ celix_status_t serviceTracker_track(serv
 			serviceTrackerCustomizer_getHandle(tracker->customizer, &handle);
 			serviceTrackerCustomizer_getModifiedFunction(tracker->customizer, &function);
 
-			function(handle, reference, tracked->service);
+			if (function != NULL) {
+				function(handle, reference, tracked->service);
+			}
 		}
 	}
 
@@ -296,7 +300,11 @@ void * serviceTracker_addingService(serv
 		serviceTrackerCustomizer_getHandle(tracker->customizer, &handle);
 		serviceTrackerCustomizer_getAddingFunction(tracker->customizer, &function);
 
-		function(handle, reference, &svc);
+		if (function != NULL) {
+			function(handle, reference, &svc);
+		} else {
+			bundleContext_getService(tracker->context, reference, &svc);
+		}
 	} else {
 		bundleContext_getService(tracker->context, reference, &svc);
 	}



Mime
View raw message