FELIX-3952 fix recursive deadlock

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1454656 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
index 3e39567..5f75d63 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
@@ -721,9 +721,9 @@
                         this.refPair = null;
                         this.trackingCount = trackingCount;
                         m_componentManager.invokeUnbindMethod( DependencyManager.this, oldRefPair, trackingCount );
-                        ungetService( oldRefPair );
                         this.refPair = nextRefPair;
                         tracked( trackingCount );
+                        ungetService( oldRefPair );
                     }
                     else //required and no replacement service, deactivate
                     {