1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-08 07:07:05 +02:00

fix crash on closing account config dialog

This commit is contained in:
Leo Franchi
2011-12-31 18:00:19 -06:00
parent aaf147a39a
commit 801d7e5d89
3 changed files with 8 additions and 5 deletions

View File

@@ -53,7 +53,6 @@ XmppAccount::XmppAccount( const QString &accountId )
XmppAccount::~XmppAccount() XmppAccount::~XmppAccount()
{ {
delete m_configWidget.data();
delete m_xmppSipPlugin.data(); delete m_xmppSipPlugin.data();
} }

View File

@@ -22,6 +22,7 @@
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QPushButton> #include <QPushButton>
#include <QDebug>
class DelegateConfigWrapper : public QDialog class DelegateConfigWrapper : public QDialog
{ {
@@ -33,7 +34,6 @@ public:
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
m_widget->setVisible( true ); m_widget->setVisible( true );
#endif #endif
setWindowTitle( title ); setWindowTitle( title );
QVBoxLayout* v = new QVBoxLayout( this ); QVBoxLayout* v = new QVBoxLayout( this );
v->setContentsMargins( 0, 0, 0, 0 ); v->setContentsMargins( 0, 0, 0, 0 );
@@ -59,6 +59,9 @@ public:
#endif #endif
} }
~DelegateConfigWrapper() { delete m_widget; }
public slots: public slots:
void toggleOkButton( bool dataError ) void toggleOkButton( bool dataError )
{ {

View File

@@ -731,7 +731,7 @@ SettingsDialog::handleAccountAdded( Account* account, bool added )
AccountManager::instance()->addAccount( account ); AccountManager::instance()->addAccount( account );
AccountManager::instance()->hookupAndEnable( account ); AccountManager::instance()->hookupAndEnable( account );
if( f && f->isUnique() ) if ( f && f->isUnique() )
{ {
// remove from actions list // remove from actions list
QAction* toremove = 0; QAction* toremove = 0;
@@ -743,12 +743,13 @@ SettingsDialog::handleAccountAdded( Account* account, bool added )
break; break;
} }
} }
if( toremove ) if ( toremove )
ui->addSipButton->removeAction( toremove ); ui->addSipButton->removeAction( toremove );
} }
} }
else else
{ // user pressed cancel {
// user pressed cancel
delete account; delete account;
} }
} }