session: Service changed cleanup
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 11 Aug 2011 14:56:18 +0000 (16:56 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 11 Aug 2011 15:40:52 +0000 (17:40 +0200)
src/session.c

index 7d9fc8b..0adc44b 100644 (file)
@@ -906,6 +906,15 @@ static void session_changed(struct connman_session *session,
                        break;
                }
 
+               /*
+                * We are not online, we are not connecting, that
+                * means we could still have a valid info->entry.
+                * Though something has changed from the service layer.
+                * Therefore we want to restart the algorithm. Before we
+                * can do that we have to cleanup a potientional old entry.
+                */
+               explicit_disconnect(session);
+
                if (info->reason == CONNMAN_SESSION_REASON_CONNECT) {
                        DBG("Retry to find a matching session");
                        /*