Andrea Campanella
Committed by Gerrit Code Review

Removing listeners from deviceService at deactivation of Group and Flow managers to avoid NPE

Change-Id: Ia7526913e4f50b4c49ce9f2ae9ddf85c2db77a3a
...@@ -160,6 +160,7 @@ public class FlowRuleManager ...@@ -160,6 +160,7 @@ public class FlowRuleManager
160 160
161 @Deactivate 161 @Deactivate
162 public void deactivate() { 162 public void deactivate() {
163 + deviceService.removeListener(deviceListener);
163 cfgService.unregisterProperties(getClass(), false); 164 cfgService.unregisterProperties(getClass(), false);
164 deviceInstallers.shutdownNow(); 165 deviceInstallers.shutdownNow();
165 operationsService.shutdownNow(); 166 operationsService.shutdownNow();
......
...@@ -102,6 +102,7 @@ public class GroupManager ...@@ -102,6 +102,7 @@ public class GroupManager
102 102
103 @Deactivate 103 @Deactivate
104 public void deactivate() { 104 public void deactivate() {
105 + deviceService.removeListener(deviceListener);
105 cfgService.unregisterProperties(getClass(), false); 106 cfgService.unregisterProperties(getClass(), false);
106 store.unsetDelegate(delegate); 107 store.unsetDelegate(delegate);
107 eventDispatcher.removeSink(GroupEvent.class); 108 eventDispatcher.removeSink(GroupEvent.class);
......