Commit 6f8d606b authored by Raine Makelainen's avatar Raine Makelainen

Cleanup dbus interface destructions

parent 8ad283ff
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
DeclarativeConnectionAgent::DeclarativeConnectionAgent(QObject *parent): DeclarativeConnectionAgent::DeclarativeConnectionAgent(QObject *parent):
QObject(parent), QObject(parent),
connManagerInterface(0) connManagerInterface(nullptr)
{ {
connectiondWatcher = new QDBusServiceWatcher(CONND_SERVICE,QDBusConnection::sessionBus(), connectiondWatcher = new QDBusServiceWatcher(CONND_SERVICE,QDBusConnection::sessionBus(),
QDBusServiceWatcher::WatchForRegistration | QDBusServiceWatcher::WatchForRegistration |
...@@ -48,10 +48,8 @@ DeclarativeConnectionAgent::~DeclarativeConnectionAgent() ...@@ -48,10 +48,8 @@ DeclarativeConnectionAgent::~DeclarativeConnectionAgent()
void DeclarativeConnectionAgent::connectToConnectiond(QString) void DeclarativeConnectionAgent::connectToConnectiond(QString)
{ {
if (connManagerInterface) { delete connManagerInterface;
delete connManagerInterface; connManagerInterface = nullptr;
connManagerInterface = 0;
}
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(CONND_SERVICE)) { if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(CONND_SERVICE)) {
qDebug() << Q_FUNC_INFO << QString("connection service not available").arg(CONND_SERVICE); qDebug() << Q_FUNC_INFO << QString("connection service not available").arg(CONND_SERVICE);
...@@ -143,10 +141,8 @@ void DeclarativeConnectionAgent::onUserInputRequested(const QString &service, co ...@@ -143,10 +141,8 @@ void DeclarativeConnectionAgent::onUserInputRequested(const QString &service, co
void DeclarativeConnectionAgent::connectiondUnregistered(QString) void DeclarativeConnectionAgent::connectiondUnregistered(QString)
{ {
if (connManagerInterface) { delete connManagerInterface;
delete connManagerInterface; connManagerInterface = nullptr;
connManagerInterface = 0;
}
} }
void DeclarativeConnectionAgent::startTethering(const QString &type) void DeclarativeConnectionAgent::startTethering(const QString &type)
......
Markdown is supported
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