Do a proper disconnect when deleting a connector.
[netconf.git] / opendaylight / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / netconf / listener / NetconfDeviceCommunicator.java
index aa8afbc664ac362a3667b724e41cf8b8e69379fc..5fdd9d600cf3c20ed6b53c82f1427fe24459e425 100644 (file)
@@ -241,10 +241,8 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener,
             initFuture.cancel(false);
         }
         // Disconnect from device
-        if(session != null) {
-            session.close();
-            // tear down not necessary, called indirectly by above close
-        }
+        // tear down not necessary, called indirectly by the close in disconnect()
+        disconnect();
     }
 
     @Override