Bug 280070

Summary: KMyMoney crashes with an uncaught exception when closing the current file before a GNUCash import
Product: [Applications] kmymoney Reporter: Cristian Oneț <onet.cristian>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: SVN   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Cristian Oneț 2011-08-14 11:47:18 UTC
Version:           SVN trunk (using KDE 4.7.0) 
OS:                Linux

When a file is open and the GNUCash import is triggered the user is asked if he would like to save the file before closing. If this dialog appears while in the ledger and the user answers no he gets the 'Uncaught error. Please report the details to the developers' dialog and the application crashes after closing it.

Reproducible: Didn't try

Steps to Reproduce:
1. Activate the ledgers (a file is open)
2. File->Import->GNUCash
3. Answer no

Actual Results:  
The user gets:
Uncaught error. Please report the details to the developers
Unknown account id 'A000001' in file kmymoney/mymoney/storage/mymoneyseqaccessmgr.cpp line 132

Expected Results:  
File is properly closed.
Comment 1 Thomas Baumgart 2011-08-14 11:54:32 UTC
Can you check what happens if you start KMyMoney with the option '--nocatch' on the command line? Do you get a backtrace?
Comment 2 Cristian Oneț 2011-08-14 12:24:48 UTC
I know where the exception is thrown and the cause, I'm just thinking about a proper fix.
Comment 3 Cristian Oneț 2011-08-14 12:52:33 UTC
SVN commit 1247045 by conet:

BUG: 280070
Refactored the closeFile code of the KMyMoney application which takes care to also reset the selections and use it instead of the plain MyMoneyView::closeFile which leaves the selections at the KMyMoneyApplication invalid and causing this uncaught exception.
Still todo is to investigate the other usages of MyMoneyView::closeFile in kmymoney.cpp.

 M  +36 -29    kmymoney.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1247045
Comment 4 Cristian Oneț 2011-08-14 12:56:30 UTC
SVN commit 1247046 by conet:

BUG: 280070
Refactored the closeFile code of the KMyMoney application which takes care to also reset the selections and use it instead of the plain MyMoneyView::closeFile which leaves the selections at the KMyMoneyApplication invalid and causing this uncaught exception.
Still todo is to investigate the other usages of MyMoneyView::closeFile in kmymoney.cpp.
Backported to the stable branch.

 M  +36 -29    kmymoney.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1247046