core dump fixes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1152 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-09-13 05:28:02 +00:00
parent 604b729584
commit 7cda332f9a

View File

@ -187,12 +187,15 @@ LedgerDestroy (SplitRegister *reg)
/* be sure to destroy the "blank split" */
if (reg->user_hook) {
Split *split;
Transaction *trans;
split = (Split *) (reg->user_hook);
/* split destroy will automatically remove it
* from its parent account */
xaccSplitDestroy (split);
trans = xaccSplitGetParent (split);
xaccTransBeginEdit (trans);
xaccTransDestroy (trans);
reg->user_hook = NULL;
}
}
@ -445,7 +448,7 @@ xaccSRLoadTransEntry (SplitRegister *reg, Split *split, int do_commit)
time_t secs;
double baln;
int typo = reg->type & REG_TYPE_MASK;
int style = reg->type & REG_STYLE_MASK;
/* int style = reg->type & REG_STYLE_MASK; */
/* don't even bother doing a load if there is no current cursor */
if (!(reg->table->current_cursor)) return;
@ -635,7 +638,11 @@ xaccSRCountRows (SplitRegister *reg, Split **slist,
num_virt_rows = 1;
i=0;
split = slist[0];
if (slist) {
split = slist[0];
} else {
split = NULL;
}
while (split) {
/* do not count the blank split */
if (split != ((Split *) reg->user_hook)) {
@ -801,7 +808,11 @@ printf ("load register of %d phys rows ----------- \n", reg->num_phys_rows);
i=0;
vrow = 1; /* header is vrow zero */
phys_row = reg->header->numRows;
split = slist[0];
if (slist) {
split = slist[0];
} else {
split = NULL;
}
while (split) {
/* do not load the blank split */