1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02: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 ) LastFmAccount::LastFmAccount( const QString& accountId )
: Account( accountId ) : Account( accountId )
{ {
m_infoPlugin = new LastFmPlugin( this ); m_infoPlugin = QWeakPointer< LastFmPlugin >( new LastFmPlugin( this ) );
setAccountFriendlyName( "Last.Fm" ); setAccountFriendlyName( "Last.Fm" );
m_icon.load( RESPATH "images/lastfm-icon.png" ); m_icon.load( RESPATH "images/lastfm-icon.png" );
@@ -60,7 +60,7 @@ LastFmAccount::LastFmAccount( const QString& accountId )
LastFmAccount::~LastFmAccount() LastFmAccount::~LastFmAccount()
{ {
delete m_infoPlugin; delete m_infoPlugin.data();
delete m_resolver.data(); delete m_resolver.data();
} }
@@ -106,7 +106,7 @@ LastFmAccount::icon() const
InfoPlugin* InfoPlugin*
LastFmAccount::infoPlugin() LastFmAccount::infoPlugin()
{ {
return m_infoPlugin; return m_infoPlugin.data();
} }
bool bool
@@ -126,7 +126,7 @@ LastFmAccount::saveConfig()
setScrobble( m_configWidget.data()->scrobble() ); setScrobble( m_configWidget.data()->scrobble() );
} }
m_infoPlugin->settingsChanged(); m_infoPlugin.data()->settingsChanged();
} }

View File

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