1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-18 23:09:42 +01:00

don't crash on exit

This commit is contained in:
Leo Franchi 2012-02-20 15:45:43 -05:00
parent 47e8f4ffc6
commit 502db67510
2 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@ LastFmAccountFactory::icon() const
LastFmAccount::LastFmAccount( const QString& accountId )
: Account( accountId )
{
m_infoPlugin = new LastFmPlugin( this );
m_infoPlugin = QWeakPointer< LastFmPlugin >( new LastFmPlugin( this ) );
setAccountFriendlyName( "Last.Fm" );
m_icon.load( RESPATH "images/lastfm-icon.png" );
@ -60,7 +60,7 @@ LastFmAccount::LastFmAccount( const QString& accountId )
LastFmAccount::~LastFmAccount()
{
delete m_infoPlugin;
delete m_infoPlugin.data();
delete m_resolver.data();
}
@ -106,7 +106,7 @@ LastFmAccount::icon() const
InfoPlugin*
LastFmAccount::infoPlugin()
{
return m_infoPlugin;
return m_infoPlugin.data();
}
bool
@ -126,7 +126,7 @@ LastFmAccount::saveConfig()
setScrobble( m_configWidget.data()->scrobble() );
}
m_infoPlugin->settingsChanged();
m_infoPlugin.data()->settingsChanged();
}

View File

@ -91,7 +91,7 @@ public:
private:
bool m_authenticated;
QWeakPointer<QtScriptResolver> m_resolver;
Tomahawk::InfoSystem::LastFmPlugin* m_infoPlugin;
QWeakPointer<Tomahawk::InfoSystem::LastFmPlugin> m_infoPlugin;
QWeakPointer<LastFmConfig> m_configWidget;
QPixmap m_icon;
};