Commit edccd9cb authored by Àlex Fiestas's avatar Àlex Fiestas
Browse files

Remove ObexSession from m_sessionMap when the object is destroyed

BUG: 308324
parent 71a08b93
......@@ -181,6 +181,7 @@ void ObexFtpDaemon::stablishConnection(QString dirtyAddress)
QDBusPendingReply <QDBusObjectPath > rep = d->m_manager->CreateBluetoothSession(address, "00:00:00:00:00:00", "ftp");
d->m_sessionMap[address] = new ObexSession("org.openobex", rep.value().path(), QDBusConnection::sessionBus(), 0);
connect(d->m_sessionMap[address], SIGNAL(destroyed(QObject *)), SLOT(sessionDestroyed(QObject*)));
kDebug(dobex()) << "Path: " << rep.value().path();
}
......@@ -374,6 +375,11 @@ void ObexFtpDaemon::sessionDisconnected()
delete session;
}
void ObexFtpDaemon::sessionDestroyed(QObject* obj)
{
d->m_sessionMap.remove(d->m_sessionMap.key(static_cast<ObexSession*>(obj)));
}
QString ObexFtpDaemon::getAddressFromSession(QString path)
{
kDebug(dobex()) << path;
......
......@@ -80,6 +80,7 @@ private Q_SLOTS:
void SessionClosed(QDBusObjectPath path);
void sessionDisconnected();
void sessionDestroyed(QObject *obj);
//Dbus interface
public Q_SLOTS:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment