Commit a4dfd6c8 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Nicolas Jager

fix crash when last account is destroyed

When deleting the last account, method ProfileModelPrivate::slotAccountRemoved
destroy the account then save the profile.
This last triggers NewAccountModelPimpl::slotProfileUpdated().
But this one access to an empty account array (as all account are destroyed).

Re-order profile-save/account delete to solve the issue (save first, destroy after).

Change-Id: I427a51c3d1f97d0127567531616f360df45e4652
Reviewed-by: default avatarNicolas Jäger <>
parent e9924324
......@@ -254,10 +254,10 @@ void ProfileModelPrivate::slotAccountRemoved(Account* a)
const int accIdx = n->m_Index;
q_ptr->beginRemoveRows(profIdx, accIdx, accIdx);
for (int i = accIdx; i < n->parent->children.size(); i++)
delete n;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment