Bug 219739

Summary: Crash opening ledger view when underlying data is deleted
Product: [Applications] kmymoney Reporter: Fernando Vilas <fvilas>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In:

Description Fernando Vilas 2009-12-22 21:25:46 UTC
Version:           svn rev 1064879 (using KDE 4.3.4)
Compiler:          gcc 4.3.3 
OS:                Linux
Installed from:    Slackware Packages

Open a ledger from the categories view.
Return to the categories view.
Delete the original category.
Attempt to open the ledger for a different category.
Crash.

The re-opening of the ledger view causes a resize event in the ledger view. That attempts to get the text for the splits in each transaction object. Since the account id is invalid, the storage object (both xml and db) will throw. If this exception is caught and ignored, KPageWidget throws a MyMoneyException. Using gdb, it does not show the source of that exception in the call stack.
Comment 1 Thomas Baumgart 2009-12-24 12:14:46 UTC
The exception is thrown in kmymoney/widgets/transaction.cpp line 1165.
Comment 2 Fernando Vilas 2009-12-26 16:40:09 UTC
SVN commit 1066265 by fvilas:

BUG: 219739 \n Do not crash when the account in the ledger view is deleted and ledger view is refreshed.

 M  +1 -1      mymoney/mymoneyexception.cpp  
 M  +13 -1     widgets/register.cpp  
 M  +13 -7     widgets/selectedtransaction.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1066265
Comment 3 Fernando Vilas 2009-12-26 16:41:59 UTC
That was one. There was another, but the trick of putting a breakpoint in the ctor for MyMoneyException found the other.