You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2015/11/20 13:11:31 UTC
celix git commit: CELIX-269: Improve error checking dependency manager
Repository: celix
Updated Branches:
refs/heads/develop 77b8e711f -> 15e872765
CELIX-269: Improve error checking dependency manager
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/15e87276
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/15e87276
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/15e87276
Branch: refs/heads/develop
Commit: 15e87276535a3c57ed6e68a9d466647e3f17c32c
Parents: 77b8e71
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Nov 20 13:10:35 2015 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Nov 20 13:10:35 2015 +0100
----------------------------------------------------------------------
dependency_manager/private/src/dm_component_impl.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/15e87276/dependency_manager/private/src/dm_component_impl.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_component_impl.c b/dependency_manager/private/src/dm_component_impl.c
index fe782bb..f368e7d 100644
--- a/dependency_manager/private/src/dm_component_impl.c
+++ b/dependency_manager/private/src/dm_component_impl.c
@@ -666,9 +666,15 @@ celix_status_t component_handleChange(dm_component_pt component) {
bool transition = false;
do {
oldState = component->state;
- component_calculateNewState(component, oldState, &newState);
- component->state = newState;
- component_performTransition(component, oldState, newState, &transition);
+ status = component_calculateNewState(component, oldState, &newState);
+ if (status == CELIX_SUCCESS) {
+ component->state = newState;
+ status = component_performTransition(component, oldState, newState, &transition);
+ }
+
+ if (status != CELIX_SUCCESS) {
+ break;
+ }
} while (transition);
return status;
@@ -730,6 +736,7 @@ celix_status_t component_calculateNewState(dm_component_pt component, dm_compone
}
} else {
//should not reach
+ *newState = DM_CMP_STATE_INACTIVE;
status = CELIX_BUNDLE_EXCEPTION;
}