@@ -56,8 +56,9 @@ void URLDispatcher::setActive(bool value)
5656 if (value == active())
5757 return;
5858
59+ QDBusConnection connection = QDBusConnection::sessionBus();
60+
5961 if (value) {
60− QDBusConnection connection = QDBusConnection::sessionBus();
6162 URLDispatcherInterface *dispatcher = new URLDispatcherInterface(this);
6263 connection.registerObject(QStringLiteral("/com/canonical/URLDispatcher"),
6364 dispatcher,
@@ -65,6 +66,7 @@ void URLDispatcher::setActive(bool value)
6566 connection.registerService(QStringLiteral("com.canonical.URLDispatcher"));
6667 m_dispatcher = dispatcher;
6768 } else {
69+ connection.unregisterService(QStringLiteral("com.canonical.URLDispatcher"));
6870 delete m_dispatcher;
6971 m_dispatcher = nullptr;
7072 }