1) When deleting a sched transaction, delete the recurrence properly (SQL backend)

2) Fix bug 586558 – When a scheduled transaction is deleted, the objects aren't cleaned up properly
The problem is that the xaccSchedXactionFree() function didn't properly call qof to commit the
delete operation.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18180 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Phil Longstaff
2009-07-06 23:11:56 +00:00
parent 06d7cdea42
commit bde496195d
7 changed files with 31 additions and 12 deletions

View File

@@ -296,11 +296,15 @@ gnc_sql_save_schedxaction( GncSqlBackend* be, QofInstance* inst )
}
is_ok = gnc_sql_do_db_operation( be, op, SCHEDXACTION_TABLE, GNC_SX_ID, pSx, col_table );
guid = qof_instance_get_guid( inst );
gnc_sql_recurrence_save_list( be, guid, gnc_sx_get_schedule( pSx ) );
if( op == OP_DB_INSERT || op == OP_DB_UPDATE ) {
gnc_sql_recurrence_save_list( be, guid, gnc_sx_get_schedule( pSx ) );
} else {
gnc_sql_recurrence_delete( be, guid );
}
if( is_ok ) {
// Now, commit any slots
if( !qof_instance_get_destroying(inst) ) {
if( op == OP_DB_INSERT || op == OP_DB_UPDATE ) {
is_ok = gnc_sql_slots_save( be, guid, is_infant, qof_instance_get_slots( inst ) );
} else {
is_ok = gnc_sql_slots_delete( be, guid );