need to close windows before destroying groups

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@267 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1997-12-04 08:39:00 +00:00
parent c7263cb8a7
commit f89e022530
2 changed files with 18 additions and 0 deletions

View File

@ -54,4 +54,19 @@ xaccAccountWindowDestroy (Account *acc)
} }
/* ------------------------------------------------------ */
void
xaccGroupWindowDestroy (AccountGroup *grp)
{
int i;
if (!grp) return;
/* recursively destroy windows associated with children */
for (i=0; i<grp->numAcc; i++) {
xaccAccountWindowDestroy (grp->account[i]);
}
}
/************************** END OF FILE *************************/ /************************** END OF FILE *************************/

View File

@ -895,6 +895,9 @@ fileMenubarCB( Widget mw, XtPointer cd, XtPointer cb )
newfile = fileBox(toplevel,OPEN, "*.dat"); newfile = fileBox(toplevel,OPEN, "*.dat");
if (newfile) { if (newfile) {
datafile = newfile; datafile = newfile;
/* destroy open windows first, before destroying the group itself */
xaccGroupWindowDestroy (grp);
freeAccountGroup (grp); freeAccountGroup (grp);
/* load the accounts from the users datafile */ /* load the accounts from the users datafile */