From f396f59922aa456123345cd9f1552965bfd4ee02 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Fri, 12 Feb 2016 22:13:39 +0100 Subject: [PATCH] Fix xmpp info plugin --- src/accounts/xmpp/sip/XmppSip.cpp | 7 +++---- src/accounts/xmpp/sip/XmppSip.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/accounts/xmpp/sip/XmppSip.cpp b/src/accounts/xmpp/sip/XmppSip.cpp index 8590d9c8c..2361dd932 100644 --- a/src/accounts/xmpp/sip/XmppSip.cpp +++ b/src/accounts/xmpp/sip/XmppSip.cpp @@ -194,9 +194,9 @@ InfoSystem::InfoPluginPtr XmppSipPlugin::infoPlugin() { if ( m_infoPlugin.isNull() ) - m_infoPlugin = QPointer< Tomahawk::InfoSystem::XmppInfoPlugin >( new Tomahawk::InfoSystem::XmppInfoPlugin( this ) ); + m_infoPlugin = QSharedPointer< Tomahawk::InfoSystem::XmppInfoPlugin >( new Tomahawk::InfoSystem::XmppInfoPlugin( this ) ); - return InfoSystem::InfoPluginPtr( m_infoPlugin.data() ); + return m_infoPlugin; } @@ -285,7 +285,7 @@ XmppSipPlugin::onConnect() // load XmppInfoPlugin if ( infoPlugin() && Tomahawk::InfoSystem::InfoSystem::instance()->workerThread() ) { - infoPlugin().data()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() ); + infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() ); Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() ); } @@ -359,7 +359,6 @@ XmppSipPlugin::onDisconnect( Jreen::Client::DisconnectReason reason ) if ( !m_infoPlugin.isNull() ) { Tomahawk::InfoSystem::InfoSystem::instance()->removeInfoPlugin( infoPlugin() ); - delete m_infoPlugin; } } diff --git a/src/accounts/xmpp/sip/XmppSip.h b/src/accounts/xmpp/sip/XmppSip.h index 73da244dd..a5c8d4f91 100644 --- a/src/accounts/xmpp/sip/XmppSip.h +++ b/src/accounts/xmpp/sip/XmppSip.h @@ -128,7 +128,7 @@ private: int m_currentPort; QString m_currentResource; - QPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin; + QSharedPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin; Tomahawk::Accounts::Account::ConnectionState m_state; // sort out