You are receiving this mail because:
You are the assignee for the bug, or are watching the assignee.
faure kde org changed:
What |Removed |Added
Status|NEW |RESLVED
Resolution| |FIXED
Additional Comments From faure kde org 2007-02-09 16:10
SVN commit 631934 by dfaure:
Found the reason why 's assert below was hit
assert( mFolder ); // George says "better to crash then lose mail"
The configuration dialog creates temporary copies of the account when modifying one;
but it doesn't delete that copy when closing with Cancel. What's more, the copied account
started its own timer for interval-mail-checking, and when that timer fired, KMAcctCachedImap
would crash due to mFolder=0. So:
1) delete things in the dtor to avoid the account memleak
2) don't start the mailcheck timer when simply setting the checkinterval of an account,
only when the account is added to the AccountManager for real.
BUG: 117935
M +23 -2 configuredialog.cpp
M +2 -1 configuredialog_p.h
M +6 -6 kmaccount.cpp
#631933:631934
@ -1147,7 +1147,29 @
this, SLT(slotEditNotifications()) );
}
+AccountsPageReceivingTab::~AccountsPageReceivingT ab()
+{
+ // When hitting Cancel or closing the dialog with the window-manager-button,
+ // we have a number of things to clean up:
+ // The newly created accounts
+ QValueList< QGuardedPtr<KMAccount>::Iterator it;
+ for (it = mNewAccounts.begin(); it != mNewAccounts.end(); ++it ) {
+ delete (*it);
+ }
+ mNewAccounts.clear();
+
+ // The modified accounts
+ QValueList<ModifiedAccountsType*>::Iterator j;
+ for ( j = mModifiedAccounts.begin() ; j != mModifiedAccounts.end() ; ++j ) {
+ delete (*j)->newAccount;
+ delete (*j);
+ }
+ mModifiedAccounts.clear();
+
+
+}
+
void ()
{
QListViewItem * item = mAccountList->selectedItem();
@ -1398,8 +1420,7 @
// Add accounts marked as new
QValueList< QGuardedPtr<KMAccount>::Iterator it;
for (it = mNewAccounts.begin(); it != mNewAccounts.end(); ++it ) {
- kmkernel->acctMgr()->add( *it );
- (*it)->installTimer();
+ kmkernel->acctMgr()->add( *it ); // calls installTimer too
}
// Update accounts that have been modified
#631933:631934
@ -349,6 +349,7 @
QBJECT
public:
AccountsPageReceivingTab( QWidget * parent=0, const char * name=0 );
+ ~AccountsPageReceivingTab();
QString helpAnchor() const;
void save();
@ -384,7 +385,7 @
QGuardedPtr< KMAccount oldAccount;
QGuardedPtr< KMAccount newAccount;
};
- // make this a qptrlist:
+ // make this value-based:
QValueList< ModifiedAccountsType* mModifiedAccounts;
};
#631933:631934
@ -151,6 +151,11 @
{
setFolder(kmkernel->folderMgr()->findIdString(folderName), true);
}
+
+ if (mInterval == 0)
+ deinstallTimer();
+ else
+ installTimer();
}
@ -278,15 +283,10 @
void KMAccount::setCheckInterval(int aInterval)
{
if (aInterval <= 0)
- {
mInterval = 0;
- deinstallTimer();
- }
else
- {
mInterval = aInterval;
- installTimer();
- }
+ // Don't call installTimer from here! See #117935.
}
//
KMail developers mailing list
KMail-devel (AT) kde (DOT) org